select regdate, count(*) as count,
(select count(*) from tbl_count) as count_sum from
(select
case to_char(regdate,'d')
when '1' then 'Mon'
when '2' then 'Tue'
when '3' then 'Wed'
when '4' then 'Thu'
when '5' then 'Fri'
when '6' then 'Sat'
when '7' then 'Sun'
end as regdate,
to_number(to_char(regdate,'d')) as regdate_num
from tbl_count where regdate > to_date('2008-12-01 00:00:00' ,'yyyy-mm-dd hh24:mi:ss')
and regdate < add_months(to_date('2008-12-01 00:00:00','yyyy-mm-dd hh24:mi:ss'),1)) a
group by regdate,regdate_num order by regdate_num |