日期:2014-05-17  浏览次数:20659 次

关于时间的判断
有个表A ,内有字段 uid user udate(时间) ruser(推荐人) 
我要判断某个会员这个时间内60天推荐的人数。
select sum(uid) from A where ruser=xxx and 后面的时间判断怎么写啊?

------解决方案--------------------
select sum(distinct uid)  as 人数
from tb 
where ruser='用户名' and DATEDIFF(day,udate,getdate())<=60