Skip to content

Instantly share code, notes, and snippets.

@kerbelp
Last active October 3, 2016 12:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kerbelp/7efc0dfbadbfc12366cf6ee10b297ca9 to your computer and use it in GitHub Desktop.
Save kerbelp/7efc0dfbadbfc12366cf6ee10b297ca9 to your computer and use it in GitHub Desktop.
UNLOAD ('SELECT "ts", "column_a", "column_b"
FROM schema.table
WHERE ts >= (SELECT DATE_TRUNC(\'day\', (SELECT sysdate - 1)))
AND ts < (SELECT DATE_TRUNC(\'day\', (SELECT sysdate)))'
)
TO 's3://bucket/prefix'
GZIP
ESCAPE;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment