34,594
社区成员
发帖
与我相关
我的任务
分享
select convert(char(7),RTime,114),(select count(*) from 学员表 where datediff(mm,RTime,a.RTime)>0) as num
from 学员表 a
group by convert(char(7),RTime,114)
select convert(varchar(7),RTime,120) as m,
cnt=(select count(1) from tb where datediff(mm,t.RTime,RTime)>=0)
from tb t
group by convert(varchar(7),RTime,120)
select month(RTime) as m,
cnt=(select count(1) from tb where datediff(mm,t.RTime,RTime)>=0)
from tb t
group by month(RTime)
select convert(char(7),RTime,23) 月份,count(1) 学员数量
from 学员表
where datediff(mm,RTime,getdate())=0
group by convert(char(7),RTime,23)