且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将数据从一个 SQLite 数据库复制到另一个

更新时间:2023-11-27 12:10:04

您必须使用 ATTACH 命令,然后为要传输的表运行相应的 Insert Into 命令.

You'll have to attach Database X with Database Y using the ATTACH command, then run the appropriate Insert Into commands for the tables you want to transfer.

INSERT INTO X.TABLE SELECT * FROM Y.TABLE;

或者,如果列没有按顺序匹配:

Or, if the columns are not matched up in order:

INSERT INTO X.TABLE(fieldname1, fieldname2) SELECT fieldname1, fieldname2 FROM Y.TABLE;