add the old snippet md files
This commit is contained in:
parent
fc0dd204c7
commit
bcf8313a4b
110 changed files with 3048 additions and 0 deletions
21
old_snippets/temp-sqlite-table.en.md
Normal file
21
old_snippets/temp-sqlite-table.en.md
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
---
|
||||
title: "creating a temporary tabel in sqlite"
|
||||
date: 2021-09-21T10:33:46+02:00
|
||||
draft: false
|
||||
snippet_types:
|
||||
- sqlite
|
||||
- sql
|
||||
---
|
||||
|
||||
Today I needed to export some data from an sqlite tabel to csv, as part of my poverty line project.
|
||||
Using [sqlitebrowser](https://sqlitebrowser.org/) I could see the table had to much data and I only wanted
|
||||
to export a few columns. To accomplish this I learned how to create a temporary table and exported that.
|
||||
|
||||
|
||||
```sql
|
||||
DROP TABLE IF EXISTS processing_data_export;
|
||||
CREATE TEMPORARY TABLE processing_data_export AS
|
||||
SELECT x,y, county_id FROM grid;
|
||||
```
|
||||
|
||||
source: [stackoverflow](https://stackoverflow.com/questions/26491230/sqlite-query-results-into-a-temp-table)
|
||||
Loading…
Add table
Add a link
Reference in a new issue