代码之家  ›  专栏  ›  技术社区  ›  OMG Ponies

选择进入不工作状态

  •  3
  • OMG Ponies  · 技术社区  · 17 年前

    我想测试一种情况,但我需要添加一行虚拟数据来测试假设。那么根据 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
    

    但我得到以下错误消息:

    (第1行的节ID、课程ID、节号、学期、学分)

    1 回复  |  直到 6 年前
        1
  •  5
  •   Michael Todd    17 年前

    请尝试插入到: http://dev.mysql.com/doc/refman/5.0/en/ansi-diff-select-into-table.html

    编辑:哎呀。我不知道那是你列出的同一页。但是,正如它所说的,使用INSERT-INTO,因为SELECT-INTO(来自Sybase)不起作用。

    推荐文章