Skip to content

Instantly share code, notes, and snippets.

@ldenson11
Created December 3, 2019 14:40
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 ldenson11/29908090210e41b9ef60d9b2a5e7c4b0 to your computer and use it in GitHub Desktop.
Save ldenson11/29908090210e41b9ef60d9b2a5e7c4b0 to your computer and use it in GitHub Desktop.
-- find the latest complete picture of
-- tailnumber A264A4
SELECT icao,
HOP_END(ts, interval '1' minute, interval '15' minute) AS timestamp,
MAX(lat) as latitude,
MAX(lon) as longitude,
AVG(altitude) as altitude,
AVG(speed) as speed
FROM adsb_source
WHERE icao = 'A264A4'
GROUP BY icao, HOP(ts, interval '1' minute, interval '15' minute)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment