SQL SERVER 查自动本月,本年,本日的数据条件


select record_date, * from staff where datediff(month,record_date,getdate())<=1

record_date是要查的日期

<=1就是要查的日期和当前日期差1

month可改成年,月,日。都可以



猜你喜欢

转载自blog.csdn.net/wybshyy/article/details/77233848