select max(su) su,max(mo) mo,max(tu) tu,max(we) we,max(th) th,max(fr) fr,max(sa) sa from
(select case when d=1 then dd end su,
case when d=2 then dd end mo,
case when d=3 then dd end tu,
case when d=4 then dd end we,
case when d=5 then dd end th,
case when d=6 then dd end fr,
case when d=7 then dd end sa,
d,w,iw
from(
select dates,to_char(dates,'dd') dd,to_number(to_char(dates,'d')) d,to_char(dates,'w') w,to_char(dates+1,'iw') iw from
(select trunc(sysdate,'month')+level-1 dates from dual
connect by rownum<last_day(sysdate)-trunc(sysdate,'month'))))
group by iw
order by iw;