34,588
社区成员
发帖
与我相关
我的任务
分享
select * from Tab
where Month(Dtime) = Month(GETDATE())-6
select * from Tab
where Dtime < dateadd(month, -6, getdate())
--查询
select * from Tab
where Dtime < dateadd(month,-6,getdate())
--删除
delete from Tab
where Dtime < dateadd(month,-6,getdate())
select * from tb where dateadd(mm,dtime,getdate())=6