日期:2014-05-18 浏览次数:20517 次
select (case when t2 is null then convert(varchar(10),cast(t1 as datetime),120) else convert(varchar(10),cast(t2 as datetime),120) end) [day] , count(1) [cnt] from tb group by (case when t2 is null then convert(varchar(10),cast(t1 as datetime),120) else convert(varchar(10),cast(t2 as datetime),120) end)