SQLite: How do I save the result of a query as a CSV file?

后端 未结 6 2040

I\'m new to SQLite. Is there a way I can export the results of a query into a CSV file?

6条回答
  •  眼角桃花
    2020-11-28 01:39

    From here and d5e5's comment:

    You'll have to switch the output to csv-mode and switch to file output.

    sqlite> .mode csv
    sqlite> .output test.csv
    sqlite> select * from tbl1;
    sqlite> .output stdout
    

提交回复
热议问题