Last active
October 25, 2019 16:26
-
-
Save kgorman/a33342607ae152c6a04c9d97b124aa4a to your computer and use it in GitHub Desktop.
sample4.sql
This file contains 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
-- return aggregation of total payments | |
-- over a 1 hour tumbling window | |
SELECT SUM(CAST(amount AS numeric)) AS payment_volume, | |
CAST(TUMBLE_END(eventTimestamp, interval '1' hour) AS varchar) AS ts | |
FROM payments | |
GROUP BY TUMBLE(eventTimestamp, interval '1' hour); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment