WmZilla - Webmaster and Marketplace

The Next Generation Webmaster and Trade Forum

How to Use Oracle START WITH - CONNECT BY?

Psychomaster1

New member

0

0%

Status

Offline

Posts

28

Likes

0

Rep

0

Bits

150

3

Months of Service

0%
Hello, I have 1 table (records) and 4 columns. (Oracle/Plsql) id, value, code, parent_id Here are some example records: 1, 'abc', '1', '0' 2, 'abc', '2', '1' 3, 'abc', '3', '1' 4, 'abc', '4', '3' I am going to create a tree list from this data. The query I have created is: select * from records t where t.value='abc' START WITH t.parent_id is null or t.parent_id='0' CONNECT BY PRIOR t.code = t.parent_id Although I am not getting any errors, it is not returning any results. The computer seems to be struggling as if stuck in an infinite loop. Where could I be making a mistake? Alternatively, is there anyone who can provide an alternative solution? Thank you in advance.
 

249

6,622

6,642

Top