Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> SQL Q: Proper and best way to join 3 tables?
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