选择进入不起作用 [英] SELECT INTO not working
问题描述
我想测试一种情况,但是我需要添加一个虚拟数据行来测试假设.因此,根据此mySQL手册页对于SELECT INTO ,我的查询是正确的:
I'd like to test a situation, but I need to add a dummy row of data to test the hypothesis. So, according to this mySQL manual page for SELECT INTO, my query is correct:
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
但是我收到以下错误消息:
But I get the following error msg:
"您的SQL语法有误;请查看与您的MySQL服务器版本相对应的手册,以获取在'INTO课程附近使用的正确语法.sections_rfip (SectionID,CourseID,SectionNumber,学期,学分,位于第1行的"
"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO courses.sections_rfip (SectionID, CourseID, SectionNumber, Term, Credits, ' at line 1"
因此,INTO处有些烂处,这对我来说不明白为什么-帮助?
So there's something rotten at the INTO, which isn't obvious to me why - help?
推荐答案
Try INSERT INTO instead: http://dev.mysql.com/doc/refman/5.0/en/ansi-diff-select-into-table.html
糟糕.没意识到那是您列出的同一页面.但是,正如它所说的那样,请使用INSERT INTO,因为SELECT INTO(来自Sybase)将不起作用.
Oops. Didn't realize that was the same page you had listed. However, as it says, use INSERT INTO since SELECT INTO (from Sybase) won't work.
这篇关于选择进入不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!