1

Topic: Sorting of the field received as WAY = SYS_CONNECT_BY_PATH (prev, ' / ')

Field WAY = SYS_CONNECT_BY_PATH (prev, ' / ') - so it has been really generated. Only them it turned out... With cyclical swaps from  a tree.
I want to arrange this field, that then .
Attempt :

select dd. *, RegExp_substr (dd.way, ' [^/] + ', 1, level) as str
from (
select 6 as n, '/6/3/2/5/9/7/8/4 ' as way from dual union
select 5 as n, '/5/9/7/8/4/6/3/2 ' as way from dual
) dd
connect by RegExp_substr (dd.way, ' [^/] + ', 1, level) is not null

However for single line produces the necessary 9 lines, and for 2 (as in an example) them  510 though expected 18.
I do not understand why so much? Like even 510 = 3*17*10 not  with 9*9.
The field length is in advance unknown.
Can help?

2

Re: Sorting of the field received as WAY = SYS_CONNECT_BY_PATH (prev, ' / ')

exp98;

select dd. *, RegExp_substr (dd.way, ' [^/] + ', 1, level) as str
from (
select 6 as n, '/6/3/2/5/9/7/8/4 ' as way from dual union
select 5 as n, '/5/9/7/8/4/6/3/2 ' as way from dual
) dd
connect by RegExp_substr (dd.way, ' [^/] + ', 1, level) is not null
==> and prior dd.way = dd.way
==> and prior dbms_random.value is not null

3

Re: Sorting of the field received as WAY = SYS_CONNECT_BY_PATH (prev, ' / ')

exp98 wrote:

and for 2 (as in an example) them  510 though expected 18.

the Question on connect by

4

Re: Sorting of the field received as WAY = SYS_CONNECT_BY_PATH (prev, ' / ')

Kind  - Eh, !
I thought that  it is possible to lower.
And here who explains me magic influence "prior dbms_random.value"? In imaginations I assume somehow, and in dock it is?
And under the link realized while only that ierarhich th request is whole .