Created
October 25, 2019 14:52
-
-
Save kgorman/cc6d39b7941e58ed199f0cfe376c9665 to your computer and use it in GitHub Desktop.
sample sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- new to my airspace | |
SELECT icao, pings FROM ( | |
SELECT icao, speed, | |
COUNT(*) OVER (PARTITION BY icao ORDER BY eventTimestamp RANGE BETWEEN INTERVAL '60' SECOND PRECEDING AND CURRENT ROW) AS pings | |
FROM airplanes | |
) WHERE pings < 5 | |
AND icao like 'A%' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment