dbTalk Databases Forums  

3 tables join

comp.databases.oracle.tools comp.databases.oracle.tools


Discuss 3 tables join in the comp.databases.oracle.tools forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Nick
 
Posts: n/a

Default 3 tables join - 11-08-2007 , 09:46 AM






I have have 3 tables TableA, TableB and TableC. TableA holds the keys
to TableB and TableC. I need a query which will display the details
from TableB and TableC depending on the key in TableA.

For eg.


TableA - columns {id, relatedkey, recordType} ===recordType will hold
values like TableB or TableC
TableB - columns{id, column1}
TableC - columns{id, column1}


the query should match the related key to the id of TableA or table B
based on recordType and show the column1 value with the TabelA id so
output for this should be


id recordType column1


1 TableB value of TableB column1
2 TableC value of TableC column1


Please help.


Cheers
Nick


Reply With Quote
  #2  
Old   
DA Morgan
 
Posts: n/a

Default Re: 3 tables join - 11-08-2007 , 11:53 AM






Nick wrote:
Quote:
I have have 3 tables TableA, TableB and TableC. TableA holds the keys
to TableB and TableC. I need a query which will display the details
from TableB and TableC depending on the key in TableA.

For eg.


TableA - columns {id, relatedkey, recordType} ===recordType will hold
values like TableB or TableC
TableB - columns{id, column1}
TableC - columns{id, column1}


the query should match the related key to the id of TableA or table B
based on recordType and show the column1 value with the TabelA id so
output for this should be


id recordType column1


1 TableB value of TableB column1
2 TableC value of TableC column1


Please help.


Cheers
Nick
So what is the issue? Post your best attempt and we will guide you with
a hint or two. First write the SELECT clause, then the FROM clause, and
make your best attempt at the WHERE clause.

Post your version number and any error message you receive.
--
Daniel A. Morgan
University of Washington
damorgan@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.