没有用过SQLite的高手啊求一条不同数据库间复制表的语句,解决方法
有两个SQLite数据库文件, c:\\a.s3db c:\\b.s3db 我想把c:\\a.s3db里的某一个表oldTb复制到c:\\b.s3db 里,更名为newTb
------解决方案--------------------
- BatchFile code
C:\temp>sqlite3 db1 SQLite version 3.6.7 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> .tables t1 tx sqlite> select * from t1; 1|A 2|B sqlite> .q C:\temp>sqlite3 db2 SQLite version 3.6.7 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> .tables sqlite> ATTACH DATABASE db1 as db1; sqlite> select * from db1.t1; 1|A 2|B sqlite> create table t2 as select * from db1.t1; sqlite> select * from t2; 1|A 2|B sqlite>