user3418935
user3418935

Reputation: 33

Oracle 10g: Connect by prior

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

Answers (1)

Adam
Adam

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

Related Questions