# Save query results as csv

**URL:** <https://discuss.zetetic.net/t/save-query-results-as-csv/2343>\
**Category:** Uncategorized\
**Created:** [September 7, 2017, 10:15pm UTC](https://discuss.zetetic.net/t/save-query-results-as-csv/2343 "2017-09-07T22:15:20Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![mmoore](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/mmoore/32/858_2.png) [@mmoore](https://discuss.zetetic.net/u/mmoore)\
**Post date:** [September 7, 2017, 10:58pm UTC](https://discuss.zetetic.net/t/save-query-results-as-csv/2343/2 "2017-09-07T22:58:01Z")

</div>

@Joe_Foley

Thanks for posting. Let me preface my response with: _We (Zetetic) didn’t create DB Browser for SQLite_

I’m unsure if the desired functionality exists within the current interface but @justinclift would know for sure.

You could adjust your query to create a new table based on your current `SELECT` statement and then print out the newly created table as a CSV.

So take this example table:

![Sample_Books_Table](https://us1.discourse-cdn.com/flex016/uploads/zetetic/original/1X/2d60ae9fb2a6baeff429731ec0108bd0d97f5ed3.png)

Let’s say the query you want to export is:

```auto
SELECT title, author FROM books WHERE price > 10;

```

You could adjust it to be:

```auto
CREATE TABLE books_10 AS SELECT title, author FROM books WHERE price > 10;

```

Which would generate a table like:

![books_10_table](https://us1.discourse-cdn.com/flex016/uploads/zetetic/original/1X/effff64c15fe1a25e4036c126d87157139bf6c2c.png)

Then you can go to File → Export → Export Table(s) as CSV and select the newly created table generated by your query (books\_10) in the example here.

 ![Export_Table_As_CSV](https://us1.discourse-cdn.com/flex016/uploads/zetetic/original/1X/4abf49d488aee3f63a2e1b6e00ceb90a453bb659.png)

After exporting you’ll most likely want to run a query to discard the table that was created by the SELECT statement, something like:

```auto
DROP TABLE books_10;

```

Hope this helps!

Cheers,  
Micah

---

_[View the full topic](https://discuss.zetetic.net/t/save-query-results-as-csv/2343)._
