1.最近7天:datediff(DAY,lepu_ImplantedDate,getdate()) <7
2.最近一个月:datediff(day,datefield,getdate()) <=30
3.获取第一条数据:select top(1) DomainName from SystemUser,select top(1) * from SystemUser
4.分组并排序:select * from SystemUser group by BusinessUnitIdName order by lepu_Age desc