Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> SQL Q: Proper and best way to join 3 tables?

SQL Q: Proper and best way to join 3 tables?

From: Rob Williamson <robw_at_physics.umd.edu>
Date: Tue, 27 Sep 2005 16:24:54 -0400
Message-ID: <4339AA96.EE57A5F6@physics.umd.edu>


If table A is the parent table and B and C are children with the PK of A being a FK in each of B and C.

I have tried:
select A.pk,B.fk,C.fk
from A,B,C
where A.pk = B.fk
and A.pk = C.fk;

This does not seem to work.

Basically I have an inventory table, a cost table and a comments table.

The part_no key is the pk of Inventory and is also a foreign key in the other two tables. I am trying to make a query that returns all the Inventory with the Unit_Cost from the Cost table as well as a Manufacturer from the Comments table.
I can do two tables but not 3.
Help.
Rob Received on Tue Sep 27 2005 - 15:24:54 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US