Skip to content

Instantly share code, notes, and snippets.

@gnsx
Last active August 23, 2019 09:27
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 gnsx/06afdb0eb39bc86b4819e579da13616b to your computer and use it in GitHub Desktop.
Save gnsx/06afdb0eb39bc86b4819e579da13616b to your computer and use it in GitHub Desktop.
/*Athena Query to get data between dates using epoch for timestamp*/
SELECT distinct(unique_id) AS unique_id ,
second_field
FROM "table_name"
WHERE from_unixtime(epoch_time,'Asia/Kolkata') < (CURRENT_DATE - interval '1' DAY)
AND from_unixtime(epoch_time,'Asia/Kolkata') > (CURRENT_DATE - interval '2' DAY)
AND second_field = 'UPLIFTED'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment