게시일: Nov 13, 2011 4:54:8 AM
select sysdate from dual;
-------------------
SYSDATE
-------------------
2011-11-13 13:50:29
-------------------
select min(decode(to_char(this_month,'d'), 1, to_char(this_month,'dd'))) "일"
, min(decode(to_char(this_month,'d'), 2, to_char(this_month,'dd'))) "월"
, min(decode(to_char(this_month,'d'), 3, to_char(this_month,'dd'))) "화"
, min(decode(to_char(this_month,'d'), 4, to_char(this_month,'dd'))) "수"
, min(decode(to_char(this_month,'d'), 5, to_char(this_month,'dd'))) "목"
, min(decode(to_char(this_month,'d'), 6, to_char(this_month,'dd'))) "금"
, min(decode(to_char(this_month,'d'), 7, to_char(this_month,'dd'))) "토"
from (select cur_month + level -1 this_month
from (select round(trunc(sysdate), 'month') cur_month from dual)
connect by (cur_month + level -1) <= last_day(cur_month))
group by decode(to_char(this_month, 'd'), 1, to_char(this_month, 'iw')+1, to_char(this_month, 'iw'))
order by decode(to_char(this_month, 'd'), 1, to_char(this_month, 'iw')+1, to_char(this_month, 'iw'))
;
- 달력 만들기
--------------------------
일 월 화 수 목 금 토
--------------------------
01 02 03 04 05
06 07 08 09 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30
--------------------------