sqlite append two tables from two databases that have the exact same schema

前端 未结 2 2055
醉话见心
醉话见心 2021-02-06 01:47

I\'m writing data into an sqlite database, but because the data set is very large, I\'m splitting the process into five pieces. As a result, I\'m writing to five different sqlit

2条回答
  •  滥情空心
    2021-02-06 02:06

    You can use UNION or UNION ALL to merge 2 or more queries.

    Something like:

    SELECT Field1, Field2, Field3 FROM Table1
    UNION 
    SELECT Field1, Field2, Field3 FROM Table2
    

    You can use an INSERT INTO NewTableName (SELECT ...) to create a new table from that UNION.

    The ALL variant of the UNION clause includes the (eventual) duplicate records.

提交回复
热议问题