Select count(*) from WorkTime group by userid
where userid=13 and datediff(hour,max(logtime),getdate()) <2 
语句应该怎么写,谢谢!