我有这样的查询中插入行,使用像这样的子查询:INSERT查询与子查询:列计数不在行匹配值计数1
INSERT INTO Lecture_presence_Student (`presence_id`, `Lecture_id`, `Student_id`, `status`) VALUES
(
(
SELECT '' as presence_id, Lecture.Lecture_id, CourseEdition_students_Student.Student_id, 'onverwerkt'
FROM
CourseEdition_students_Student
INNER JOIN Lecture ON CourseEdition_students_Student.CourseEdition_id = Lecture.CourseEdition_id
)
)
我不明白这一点,子选择查询返回4列,与INSERT查询的编号相同。为什么它给我的错误:
Column count doesn't match value count at row 1
任何想法?
您的子查询是否返回多行? – darren102 2012-03-22 13:49:45