Skip to content

Instantly share code, notes, and snippets.

@garystafford
Created March 5, 2020 05: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 garystafford/1f96167ab76a5400b57d266619ed2079 to your computer and use it in GitHub Desktop.
Save garystafford/1f96167ab76a5400b57d266619ed2079 to your computer and use it in GitHub Desktop.
SELECT ('1970-01-01'::date + ts * interval '1 second') AS recorded_time,
created AS redshift_time,
DATEDIFF(seconds, recorded_time, redshift_time) AS diff_seconds
FROM message
ORDER BY diff_seconds;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment