CTAS,语法错误

时间:2014-07-02 09:08:27

标签: sqlite syntax-error

我对SQLite3数据库的查询有问题

查询是这样的:

CREATE TABLE new_test AS (SELECT column1,column2 FROM test1)

或者这个:

CREATE TABLE 'new_test' AS (SELECT 'column1','column2' FROM test1)

错误是这样的:

near "(": syntax error

1 个答案:

答案 0 :(得分:1)

the documentation所示,SELECT语句周围没有括号:

CREATE TABLE new_test AS SELECT column1, column2 FROM test1