sql >> Base de Datos >  >> RDS >> PostgreSQL

Agrupación de marcas de tiempo por día, no por hora

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