是否可以只转储部分数据库?我有一个包含250’000个条目的数据库.我想创建第二个,其中包含十分之一的数据……
运用
select * from table where id % 10 = 0
和设置
.output out.sql
产生一个没有二进制数据编码的文件,其方式与使用时相同
.dump dump -> the binary data gets encoded as hex bytes other way -> it gets encoded as some weird string
解决方法
您可以直接编写新数据库,而不是转储到文件:
ATTACH DATABASE New.db AS new; CREATE TABLE new.stuff AS (SELECT * FROM table WHERE id % 10 = 0);
这应该在New.db中创建表的东西.