用sql查询当天,一周,一个月的数据 数据查询,不管在网站还是在系统,都很常见,下文是介绍最常见的以日期查询的语句 select * from ShopOrder where datediff(week,ordTime,getdate()-1)=0 //查询当天日期在一周年的数据 select * from ShopOrder where datediff(day,ordTime,getdate()-1)=0 //查询当天的所有数据 --查询当天: select * fro
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', ins