我有这张桌子(节假日):
CCAA FREEDAYS
AND 01/01,01/03
MAD 01/01,03/03
EUS 01/01,31/12
....
我想获得另一个表:
CCAA FREEDAY
AND 01/01
AND 01/03
MAD 01/01
MAD 03/03
EUS 01/01
EUS 31/12
...
我正在使用这个 SQL 查询:
with t as (SELECT freedays AS txt, CCAA AS CCAA
FROM HOLIDAYS )
select REGEXP_SUBSTR (txt, '[^,]+', 1, level) as freeday, CCAA
from t
connect by REGEXP_SUBSTR (txt, '[^,]+', 1, level) is not null
但是我得到了一张有无尽行的桌子......
你能帮我吗?非常感谢。