2021
04-09
04-09
SQLServer 日期函数大全(小结)
一、统计语句1、--统计当前【>当天00点以后的数据】SELECT*FROM表WHERECONVERT(Nvarchar,dateandtime,111)=CONVERT(Nvarchar,GETDATE(),111)ORDERBYdateandtimeDESC2、--统计本周SELECT*FROM表WHEREdatediff(week,[dateadd],getdate())=03、--统计本月SELECT*FROM表WHEREdatediff(month,[dateadd],getdate())=04、统计当前SELECT*FROM表WHEREdatediff(day,[dateadd],getdate())=0Select*Fromta...
继续阅读 >