Reputation: 33
What is the difference between using PRIOR
in
CONNECT BY CUST_ID= PRIOR CUST_CUST_ID
and
CONNECT BY PRIOR CUST_ID= CUST_CUST_ID
?
Upvotes: 0
Views: 111
Reputation: 924
Prior defines parent row.
In your case: CONNECT BY PRIOR CUST_ID = CUST_CUST_ID search for the next row (parent) where cust_id is equals to cust_cust_id from the current row.
CONNECT BY CUST_ID = PRIOR CUST_CUST_ID search for the next row (parent) where cust_cust_id is equals to cust_id from the current row.
Upvotes: 1