我在DB中有一些抽象条目,它是创建日期。如何获得每月创建的平均条目?
编辑:
表具有“名称”字段和“ CreationDate”字段。
SELECT count(*) AS count, MONTH(date_column) as mnth FROM table_name GROUP BY mnth
应该为你工作
SELECT AVG(a.count) AS avg FROM ( SELECT count(*) AS count, MONTH(date_column) as mnth FROM table_name GROUP BY mnth) AS a