Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save kgorman/86b32ec35b6d32b15d34962bde07247f to your computer and use it in GitHub Desktop.

Select an option

Save kgorman/86b32ec35b6d32b15d34962bde07247f to your computer and use it in GitHub Desktop.

Revisions

  1. Kenny Gorman created this gist Apr 19, 2021.
    6 changes: 6 additions & 0 deletions 4 killer Continuous SQL query patterns_2.sql
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    SELECT
    userid,
    SUM(amount) AS theamount,
    tumble_end(timestamp, interval '1' hour) AS ending_ts
    FROM mystream
    GROUP BY userid, tumble(timestamp, interval '1' hour)