Skip to content

Instantly share code, notes, and snippets.

@cedricvidal
Last active November 15, 2018 09:59
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 cedricvidal/6eb3027ecab0ac62326f6dd5f74c55f5 to your computer and use it in GitHub Desktop.
Save cedricvidal/6eb3027ecab0ac62326f6dd5f74c55f5 to your computer and use it in GitHub Desktop.
Oracle SQL Developer - Export query to CSV
SPOOL "/tmp/export.csv"
select /*csv*/ *
from ( select /*+ FIRST_ROWS(n) */
a.*, ROWNUM rnum
from ( SELECT c1, TIMESTAMP FROM mytable ORDER BY timestamp ) a
where ROWNUM <=
110 )
where rnum >= 100;
/* Source https://stackoverflow.com/questions/4168398/how-to-export-query-result-to-csv-in-oracle-sql-developer */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment