Edit:Fik den generiske. Virkelig simpelt i sidste ende (men tog mig et stykke tid at nå dertil)
WITH words AS
( SELECT REGEXP_SUBSTR( '&txt', '\S+', 1, LEVEL ) AS word
, LEVEL AS num
FROM DUAL
CONNECT BY LEVEL <= LENGTH( REGEXP_REPLACE( '&txt', '\S+\s*', 'X' ) )
)
SELECT SYS_CONNECT_BY_PATH( W.word, ' ' )
FROM words W
CONNECT BY NOCYCLE PRIOR W.num != W.num
Edit2:Fjernede overflødige maxnum-ting. Tilbage fra tidligere forsøg