Skip to content

Instantly share code, notes, and snippets.

@evie404
Created October 19, 2020 22:33
Show Gist options
  • Save evie404/12f663f1e4403031681ab239f604bac8 to your computer and use it in GitHub Desktop.
Save evie404/12f663f1e4403031681ab239f604bac8 to your computer and use it in GitHub Desktop.
SELECT DATE_TRUNC('month', created_at) AS month, sum(count(created_at)) OVER (ORDER BY DATE_TRUNC('month', created_at)) FROM thing GROUP BY DATE_TRUNC('month', created_at);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment