Skip to content

Instantly share code, notes, and snippets.

@maxjustus
Created January 30, 2012 17:47
Show Gist options
  • Save maxjustus/1705643 to your computer and use it in GitHub Desktop.
Save maxjustus/1705643 to your computer and use it in GitHub Desktop.
group by partial date with postgres
select date_trunc('day', created_at), sum(value) from channel_stats group by date_trunc('day', created_at);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment