Help for this page

Select Code to Download


  1. or download this
    create table test_connect_by (
      parent     number,
      child      number,
      constraint uq_tcb unique (child)
    );
    
  2. or download this
    insert into test_connect_by values ( 5, 2);
    insert into test_connect_by values ( 5, 3);
    ...
    insert into test_connect_by values (null,38);
    insert into test_connect_by values (null,26);
    insert into test_connect_by values (null,16);
    
  3. or download this
    select lpad(' ',2*(level-1)) || to_char(child) s 
      from test_connect_by 
      start with parent is null
      connect by prior child = parent;
    
  4. or download this
    38
      15
    ...
      1
      12
    16