我有這樣的查詢中插入行,使用像這樣的子查詢: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