pg按日,周,月进行数据统计
pg数据库按周,月统计数据
SELECT date_trunc('WEEK', insert_time) as insertDate, SUM(data_increment) as dataTotal,SUM(human_increment) as humanTotal from human_data_sum t where t.idtype=? GROUP BY insertDate ORDER BY insertDate DESC SELECT date_trunc('MONTH', insert_time) as insertDate, SUM(data_increment) as dataTotal,SUM(human_increment) as humanTotal from human_data_sum t where t.idtype=? GROUP BY insertDate ORDER BY insertDate DESC