Skip to content

Instantly share code, notes, and snippets.

@typeoneerror
Created January 6, 2012 21:33
Show Gist options
  • Select an option

  • Save typeoneerror/1572490 to your computer and use it in GitHub Desktop.

Select an option

Save typeoneerror/1572490 to your computer and use it in GitHub Desktop.
grouping, counting
select
date(created_at) as the_date,
extract(day from created_at) as the_day,
count(id) as count_all
from results
group by the_date, the_day
order by the_date;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment