with t as (
select
'111' no
, TO_DATE('20091001','YYYYMMDD') start_day
, TO_DATE('20120301','YYYYMMDD') end_day
from dual
union all
select
'222' no
, TO_DATE('20081001','YYYYMMDD') start_day
, TO_DATE('20120301','YYYYMMDD') end_day
from dual
)
select * from t
;
입력
NO START_DAY END_DAY
111 2009-10-01 00:00:00 2012-03-01 00:00:00
222 2008-10-01 00:00:00 2012-03-01 00:00:00
결과
111 2009-10-01 00:00:00 2009-12-31 00:00:00
111 2010-01-01 00:00:00 2010-12-31 00:00:00
111 2011-01-01 00:00:00 2011-12-31 00:00:00
111 2012-01-01 00:00:00 2012-03-01 00:00:00
222 2008-10-01 00:00:00 2008-12-31 00:00:00
222 2009-01-01 00:00:00 2009-12-31 00:00:00
222 2010-01-01 00:00:00 2010-12-31 00:00:00
222 2011-01-01 00:00:00 2011-12-31 00:00:00
222 2012-01-01 00:00:00 2012-03-01 00:00:00
입력에 따라 출력결과 가능 할까요 ?