62,267
社区成员
发帖
与我相关
我的任务
分享
declare @t table(regTime datetime,reg2Time datetime)
insert into @t
select '2011-10-10',null
union all
select '2011-10-10','2012-3-15'
union all
select '2011-10-11',null
union all
select '2011-10-12','2012-3-16'
union all
select '2011-10-12','2012-3-16'
union all
select '2011-10-13','2012-3-17'
union all
select '2011-10-13','2012-3-17'
union all
select '2011-10-13','2012-3-18'
select count(1) as 注册人数 from @t group by (case reg2Time when null then regTime else reg2Time end)