獲取周數據 本周 select * from table1 where datediff(week,時間字段,getdate()) = 0 上周 select * from table1 where datediff(week,時間字段,getdate()) = 1 下周 select ...
sql語句獲取本周 上一周 本月數據 獲取周數據 獲取月數據 昨天: 明天: 上月: 本月: 下月: 昨天: 明天: 最近七天: 當前年: 前一年: 后一年: ...
2018-04-23 15:51 0 10172 推薦指數:
獲取周數據 本周 select * from table1 where datediff(week,時間字段,getdate()) = 0 上周 select * from table1 where datediff(week,時間字段,getdate()) = 1 下周 select ...
1.查詢今日的所有數據 select * from 表名 where datediff(day,字段名,getdate())=0 2.查詢昨日的所有數據 select * from 表名 where datediff(day,字段名,getdate()-1)=0 3.查詢當天日期在一周 ...
本周:select * from table where datediff(week,C_CALLTIME,getdate())=0 --C_CALLTIME 為日期字段本月:select * from table where datediff(Month,C_CALLTIME ...
查詢今天數據: SELECT COUNT(1) FROM T_CALL_RECORDS WHERE TO_CHAR(T_RKSJ,'YYYY-MM-DD')=TO_CHAR(SYSDATE,'YYYY-MM-DD'); 查詢昨天數據: SELECT COUNT(1) FROM ...
查詢今天數據: 查詢昨天數據: 查詢本周數據: 查詢上周數據: 查詢本月數據: 查詢上月數據: 備注:NEXT_DAY(SYSDATE,1)函數為當前系統時間的下個星期日時間,數字1代表星期日 ...
--查詢本周記錄select * from info where datediff(week,datetim ...