1.--查询当天: select * from [TABLE] where DateDiff(dd,[dateadd],getdate())=0 2.--查询24小时内的: select * from [TABLE] where DateDiff(hh,[dateadd],getDate())<=24 3.--本月记录 SELECT * FROM [TABLE] WHERE datediff(month,[dateadd],getdate())=0 4.--本周记录 SELECT * F
当月数据 select * from table t where t.create_time >=TRUNC(SYSDATE, 'MM') and t.create_time=trunc(sysdate,'YYYY') and t.create_time=trunc(sysdate,'day')+1 and t.create_time=trunc(next_day(sysdate-8,1)+1) and t.create_time<=trunc(next_day(sysdate-8
查询当前这周的数据 SELECT name,submittime FROM enterprise WHERE YEARWEEK(date_format(submittime,’%Y-%m-%d’)) = YEARWEEK(now()); 查询上周的数据 SELECT name,submittime FROM enterprise WHERE YEARWEEK(date_format(submittime,’%Y-%m-%d’)) = YEARWEEK(now())-1; 查询当前月份的数据 se