PostgreSQL
 sql >> Database >  >> RDS >> PostgreSQL

Raggruppamento di timestamp per giorno, non per ora

SELECT date_trunc('day', user_logs.timestamp) "day", count(*) views
FROM user_logs
WHERE user_logs.timestamp >= %(timestamp_1)s
    AND user_logs.timestamp <= %(timestamp_2)s
group by 1
ORDER BY 1