我想检验一种情况,但我需要添加一行虚拟数据来检验假设。所以,根据 this mySQL manual page for SELECT INTO ,我的查询是正确的:
SELECT INTO courses.sections_rfip
(SectionID, CourseID, SectionNumber, Term, Credits, CutOffDate, StartDate, EndDate, LastDateToWithDraw, ContinuousIntake, AcceptsRegistration, Fee, Instructor, SectionDescription, RegistrationRestrictions, MeetingTime, Notes, Active, Created, SetInactive)
SELECT 3,
s.CourseID,
s.SectionNumber,
s.Term,
s.Credits,
s.CutOffDate,
s.StartDate,
s.EndDate,
s.LastDateToWithDraw,
s.ContinuousIntake,
s.AcceptsRegistration,
s.Fee,
s.Instructor,
s.SectionDescription,
s.RegistrationRestrictions,
s.MeetingTime,
s.Notes,
s.Active,
s.Created,
s.SetInactive
FROM courses.sections_rfip s
WHERE s.sectionid = 1
但我收到以下错误信息:
“您的 SQL 语法有错误;请查看与您的 MySQL 服务器版本相对应的手册,了解在 'INTO courses.sections_rfip 附近使用的正确语法 (SectionID, CourseID, SectionNumber, Term, Credits, ' at line 1"
所以 INTO 有一些问题,我不明白为什么 - 帮忙?
最佳答案
改用 INSERT INTO:http://dev.mysql.com/doc/refman/5.0/en/ansi-diff-select-into-table.html
编辑:糟糕。没有意识到那是您列出的同一页。但是,正如它所说,使用 INSERT INTO 因为 SELECT INTO(来自 Sybase)将不起作用。
关于mysql - 选择进入不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1189810/