sqlite insert into table select * from

后端 未结 3 514
予麋鹿
予麋鹿 2020-12-02 18:38

I need to move data from one table to another in my Android app

I would like to use the following sql:

insert into MYTABLE2 select id, STATUS rispos         


        
3条回答
  •  攒了一身酷
    2020-12-02 19:13

    You can specify which columns you're inserting into. Assuming that the _id column is autoincrement and you're inserting the other two columns, you can have something like this:

    insert into MYTABLE2 (riposta, data_ins)
    select STATUS risposta, DATETIME('now') data_ins from  MYTABLE 2
    

提交回复
热议问题