Query to get count of inserted records hourly wise in postgresql? I have a table that looks like:
Table name Demo
id         creation_date
1          2021-03-06 12:27:48.811
2          2021-03-06 03:56:48.875
3          2021-03-06 03:58:23.567

I need the count of records hourly wise in PostgreSql.
Postgres can truncate a date to a certain precision:
SELECT DATE_TRUNC('hour', creation_date) FROM demo

So all you have to do is group and count it:
SELECT DATE_TRUNC('hour', creation_date), COUNT(*) 
FROM demo 
GROUP BY DATE_TRUNC('hour', creation_date)