Skip to content

Instantly share code, notes, and snippets.

@leemour
Created May 15, 2018 14:26
Show Gist options
  • Save leemour/8cdf06385abe4ee911ea1d0da778d4fd to your computer and use it in GitHub Desktop.
Save leemour/8cdf06385abe4ee911ea1d0da778d4fd to your computer and use it in GitHub Desktop.
Group and count by month SQL query
SELECT count(*), DATE_TRUNC( 'month', created_at ) created_date
FROM businesses
GROUP BY created_date
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment