OMG*_*ies 3 mysql sql mysql-error-1064
我想测试一下情况,但我需要添加一行虚拟数据来测试这个假设.所以,根据SELECT INTO的mySQL手册页,我的查询是正确的:
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
Run Code Online (Sandbox Code Playgroud)
但我得到以下错误消息:
"您的SQL语法有错误;请查看与您的MySQL服务器版本对应的手册,以便在'INTO courses.sections_rfip(SectionID,CourseID,SectionNumber,Term,Credits,'第1行)附近使用正确的语法"
所以在INTO中有些东西烂了,这对我来说并不明显 - 为什么?
请尝试INSERT INTO:http://dev.mysql.com/doc/refman/5.0/en/ansi-diff-select-into-table.html
编辑:哎呀.没意识到那是你列出的那个页面.但是,正如它所说,使用INSERT INTO,因为SELECT INTO(来自Sybase)将无法工作.