Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

recursive sql call

Status
Not open for further replies.

DavidSherring

Technical User
Nov 9, 2007
17
GB
I have a table with a key, and a previous key. I need to recursively step through the table until I have the key with no previous key (i.e the original record). Is there an sql command I can use to do this, or do I need to program?

Field Names are

resource_bookings.resource_bookings_id and resource_bookings.previous_sequence_id

previous sequence_id will hold resource_bookings_id of previous record. I need the original from whence to go and get data.

Please help
 
Check out Oracle Analytic functions, specifically LEAD and LAG


In order to understand recursion, you must first understand recursion.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top