posted 13 years ago
Hi ,
Can anyone help on this?
WITH temp AS (
select to_date('01-Jun-2011','DD-Mon-YYYY') start_date, to_date('23-Jun-2011','DD-Mon-YYYY') end_date, 1 rw from dual union all
select to_date('05-Jun-2011','DD-Mon-YYYY'), to_date('07-Jun-2011','DD-Mon-YYYY'), 2 from dual union all
select to_date('05-Jun-2011','DD-Mon-YYYY'), to_date('07-Jun-2011','DD-Mon-YYYY'), 3 from dual
)
SELECT rw
, start_date + t.column_value
, t.column_value "LEVEL"
FROM temp
, TABLE(
CAST(
MULTISET (
SELECT level FROM dual CONNECT BY level <= end_date - start_date
)
AS sys.odcinumberlist
)
) t
ORDER BY 1, 2
;
i found this solution on a forum..
can anyone explain? what is CAST() and MULTISET(), sys.odcinumberlist here