开发者

How do I append records to a Sqlite table from a CSV file?

开发者 https://www.devze.com 2023-02-19 19:02 出处:网络
I receive several updated versions of CSV files with new lines appended at the end. I want that the Import command only appends th开发者_Python百科e records that are not in the table yet.

I receive several updated versions of CSV files with new lines appended at the end.

I want that the Import command only appends th开发者_Python百科e records that are not in the table yet.

Thank you


Maybe you can use the INSERT OR IGNORE INTO syntax?

Like: import your CSV into a temp table, and copy over all non-duplicate rows into your final table. Of course, you would need to make sure that the existing rows violate some kind of UNIQUE constraint.

0

精彩评论

暂无评论...
验证码 换一张
取 消