//生成某月所有日期天数并显示为星期几 select日期, case to_char(to_date(日期,'yyyy/mm/dd'),'D') when '1' then '星期日' when '2' then '星期一' when '3' then '星期二' when '4' then '星期三' when '5' then '星期四' when '6' then '星期五' when '7' then '星期六' else '' end 星期 from ( selectto_char(to_date('2017/03/1', 'YYYY/MM/DD') + ROWNUM - 1,'YYYY/MM/DD') 日期 FROM DUAL connect by rownum<= (add_months(TO_DATE('2017/03/1', 'YYYY/MM/DD'), 1) - TO_DATE('2017/03/1','YYYY/MM/DD')))
效果图:
|