Back to Playground Home

Count the number of rows grouped by week

select DATETRUNC('week', timestamp_field) AS ts, count(*)
from users
group by ts
order by count(*) DESC