select
count(1) as callcount,
COUNT(TBL_Call_Duration) as durationcount,
COUNT(distinct(tbl_call_caller)) as usercount,
CONVERT(varchar(100),TBL_Call_EndTime,111) as da
from tbl_call
group by CONVERT(varchar(100),TBL_Call_EndTime,111)
order by da
SELECT da, name, cnt
FROM
(
select
count(1) as callcount,
COUNT(TBL_Call_Duration) as durationcount,
COUNT(distinct(tbl_call_caller)) as usercount,
CONVERT(varchar(100),TBL_Call_EndTime,111) as da
from tbl_call
group by CONVERT(varchar(100),TBL_Call_EndTime,111)
) p
UNPIVOT
(cnt FOR name IN
(callcount,durationcount,usercount)
)AS unpvt;