PostgreSQL 统计每个月数据量
select to_char(time ,'yyyy-MM'),count(1) from table where createdate>=to_date('2000-01', 'yyyy-MM') and createdate <= to_date('2011-01', 'yyyy-MM') group by to_char(time ,'yyyy-MM')
PostgreSQL 统计每个月数据量
select to_char(time ,'yyyy-MM'),count(1) from table where createdate>=to_date('2000-01', 'yyyy-MM') and createdate <= to_date('2011-01', 'yyyy-MM') group by to_char(time ,'yyyy-MM')