PostgreSQL:运行查询“按分钟”的行数
我需要为每分钟查询到该分钟的行总数。
到目前为止,我所能达到的最好成绩并不能做到这一点。它返回每分钟的计数,而不是每分钟的总计数:
SELECT COUNT(id) AS count , EXTRACT(hour from "when") AS hour , EXTRACT(minute from "when") AS minute FROM mytable GROUP BY hour, minute
牧羊人nacy
相关分类