Skip to content

Instantly share code, notes, and snippets.

@ldenson11
Created December 3, 2019 14:39
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/57be6ecb715a0d8835e03a85a9c3d16b to your computer and use it in GitHub Desktop.
Save ldenson11/57be6ecb715a0d8835e03a85a9c3d16b to your computer and use it in GitHub Desktop.
-- average pressure over 5 second window
SELECT TUMBLE_END(ts, interval '5' second) AS ts,
rigId,
sensorName,
AVG(sensorValue) AS pressure
FROM rigData
WHERE sensorType = 'Pressure'
GROUP BY rigId, sensorName, TUMBLE(ts, interval '5' second)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment