SQlite: select into?

前端 未结 4 1558
Happy的楠姐
Happy的楠姐 2020-12-01 00:57

I\'m not sure if I can use select into to import data from another table like this:

select * into
  bookmark1 
from bookmark;    

Is it tru

相关标签:
4条回答
  • 2020-12-01 01:07
    create table NewTable as
    select * from OldTable where 1 <> 1
    

    This will copy data structure for you.

    0 讨论(0)
  • 2020-12-01 01:09

    I assume that bookmark1 is a new table that you have created which is same as the bookmark table. In that case you can use the following format.

    CREATE TABLE bookmark1 AS SELECT * FROM bookmark;
    

    Or you can also use the insert statement with subquery. For different insert statement options refer: SQL As Understood By SQLite

    0 讨论(0)
  • 2020-12-01 01:21

    You can try this query:

    insert into bookmark1 select * from bookmark
    
    0 讨论(0)
  • 2020-12-01 01:21

    You could do:

    create table bookmark1 as select * from bookmark;
    
    0 讨论(0)
提交回复
热议问题