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

后端 未结 6 2053

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:19

    Good answers from gdw2 and d5e5. To make it a little simpler here are the recommendations pulled together in a single series of commands:

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

提交回复
热议问题