Home » SQL & PL/SQL » SQL & PL/SQL » 'Recursive' query?
'Recursive' query? [message #2340] Mon, 08 July 2002 08:45 Go to next message
Mike Nibeck
Messages: 49
Registered: May 2002
Member
Not quite sure if 'recursive' is the right word or not, but here's what I have:

Customer Table
--------
Cust_ID (PK)
FName
LName
etc.
etc.

Marriage_Link table
-------------
Cust_ID (PK)
Marriage_Cust_ID

I need to query the Customer table based on a specified Cust_ID and the get FName, LName. I then need to link to the Marriage_Link table, get the Marriage_Cust_ID field, use that to re-query the Customer table to get the Fname, Lname of the spouse.

Ideas?

Thanks,

Mike
Re: 'Recursive' query? [message #2341 is a reply to message #2340] Mon, 08 July 2002 09:30 Go to previous message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
select a.custid,b.marriage_cust_id,a.Fname,a.Lname
from customer a , marriage_link b
where a.custid=b.custid;
Previous Topic: Take a row in a table and move it to another table - Need help
Next Topic: Trigger Beginner
Goto Forum:
  


Current Time: Thu Apr 25 15:37:50 CDT 2024