DuckDB 2 · Files and command line

Write query results to CSV

Export a result as CSV with a header.

COPY (SELECT * FROM sales) TO 'sales.csv' (HEADER, DELIMITER ',');

Official DuckDB 2 documentation

More files and command line commands

All files and command line commands · DuckDB 2 cheatsheet

Was this page helpful?