SQLite相当于Access SQL中的SELECT ... INTO

时间:2017-05-09 13:00:48

标签: sql database sqlite ms-access

我有一个Microsoft Access查询,它从两个独立的表(在同一个数据库中)中获取一些数据并将其合并到一个新创建的表中,SQL如下:

SELECT Student_Answers.Student_Login, Student_Answers.Question_ID, Student_Answers.Status, Student_Answers.TimeStamp, Student_Answers.Student_Answer, Questions.Question_type, Questions.Question_ID INTO [tempAnswered&Unasweredwith_UI]

FROM (Questions LEFT JOIN Student_Answers ON Questions.Question_ID = Student_Answers.Question_ID)

WHERE (((Student_Answers.Student_Login)<>'10l.delbasso' Or (Student_Answers.Student_Login) Is Null));"

在SQLite中运行相同的查询时,它告诉我&#34; INTO &#34;命令不受支持。我曾尝试在线寻找解决方案(例如Access和SQLite之间的翻译)但我无法找到解决方案,因为我的问题似乎非常具体。如果有人可以帮助我让SQLite查询工作,我会很感激。

谢谢:)

1 个答案:

答案 0 :(得分:0)

this answer中提到的类似问题,SQLite支持

CREATE TABLE table2 AS SELECT * FROM table1

,您可以使用它来代替Access SQL使用的SELECT ... INTO table2 FROM table1表单。