Maxifly |
а это не то же самое достигается с использованием
order by connect_by_root, bcode |
Did you test it? Very buggy. For example:
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select lpad(' ',level*2) || ename ename,
2 job,
3 sal
4 from emp
5 start with mgr is null
6 connect by mgr = prior empno
7 order siblings by connect_by_root(job),sal
8 /
sal
*
ERROR at line 3:
ORA-00600: internal error code, arguments: [qkacon:FJswrwo], [1], [], [], [],
[], [], []
SQL> select lpad(' ',level*2) || ename ename,
2 job,
3 sal
4 from emp
5 start with mgr is null
6 connect by mgr = prior empno
7 order siblings by connect_by_root(job),ename
8 /
order siblings by connect_by_root(job),ename
*
ERROR at line 7:
ORA-00976: LEVEL, PRIOR, or ROWNUM not allowed here
SQL> select lpad(' ',level*2) || ename enameX,
2 job,
3 sal
4 from emp
5 start with mgr is null
6 connect by mgr = prior empno
7 order siblings by connect_by_root(job),ename
8 /
sal
*
ERROR at line 3:
ORA-00600: internal error code, arguments: [qkacon:FJswrwo], [1], [], [], [],
[], [], []
SQL> select lpad(' ',level*2) || ename ename,
2 job,
3 sal salX
4 from emp
5 start with mgr is null
6 connect by mgr = prior empno
7 order siblings by connect_by_root(job),sal
8 /
sal salX
*
ERROR at line 3:
ORA-03113: end-of-file on communication channel
SQL> connect scott/tiger
Connected.
SQL> select lpad(' ',level*2) || ename ename,
2 job,
3 sal salX
4 from emp
5 start with mgr is null
6 connect by mgr = prior empno
7 order siblings by connect_by_root(job),salX
8 /
sal salX
*
ERROR at line 3:
ORA-00600: internal error code, arguments: [qkacon:FJswrwo], [1], [], [], [],
[], [], []
SQL>
SY.