SELECT INTO statement in sqlite

2019-01-13 20:37发布

问题:

Here I a wanna know that whether sqlite supports SELECT INTO statement.

Actually I am trying to save the data in my table1 into table2 as a backup of my database before modifying the data.

for that when I am using the SELECT INTO Statement a syntax error was generating as:

My query as:

SELECT * INTO equipments_backup FROM equipments;

"Last Error Message:near "INTO":syntax error".

回答1:

sqlite does not support SELECT INTO.

You can probably use this form instead:

INSERT INTO equipments_backup SELECT * FROM equipments;



回答2:

Instead of

SELECT * INTO equipments_backup FROM equipments

try

CREATE TABLE equipments_backup AS SELECT * FROM equipments


标签: sqlite3