34,587
社区成员
发帖
与我相关
我的任务
分享
select convert(varchar(10),CreateDate,120) 时间,
count(distinct case when typeid = 1 then custid end) 类别1不重复,
count(case when typeid = 1 then custid end) 类别1总数,
count(distinct case when typeid = 2 then custid end) 类别2不重复,
count(case when typeid = 2 then custid end) 类别2总数
from tb
group by convert(varchar(10),CreateDate,120)