SQL · Aggregation and grouping
group by expression
Groups by a computed value. PostgreSQL needs the same expression in SELECT.
Syntax
group by date_trunc('month', created_at)Example
Open in the lab
Notes
SQLite equivalents use strftime().
More in this group
Learn this in the course
Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.