Skip to content

Instantly share code, notes, and snippets.

@xximjasonxx
Created May 1, 2020 01:46
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 xximjasonxx/c617e509cbce3c96f8d0a316515eadfd to your computer and use it in GitHub Desktop.
Save xximjasonxx/c617e509cbce3c96f8d0a316515eadfd to your computer and use it in GitHub Desktop.
WITH
FirstLetters AS
(
SELECT SUBSTRING(name, 1, 1) as letter
FROM [NamesData]
),
LetterCounts AS
(
SELECT letter, COUNT(letter) as letterCount
FROM [FirstLetters]
GROUP BY letter, TumblingWindow(second, 30)
)
SELECT * INTO [SaveGroupedData] FROM LetterCounts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment