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

Home -> Community -> Usenet -> comp.databases.theory -> Join from de-normalized table

Join from de-normalized table

From: Grant Sayer <gsayer1_at_bigpond.net.au>
Date: 14 Aug 2002 04:22:48 -0700
Message-ID: <de9238fe.0208140322.7a383450@posting.google.com>


Hi

A question on a SQL query problem. I've inherited a DB (don't you just hate that :-)) which has (as part of this problem) 3 tables; called Articles, Images and SpecialImages. Now the relationship in place is Articles --1-to-many --> SpecialImages and Articles--1-to-1-->Images. So some of the fields are like

Article(id, image_id, sp_id1, sp_id2, sp_id3) where image_id is the FK to the Image table, and sp_idX is a foreign key into the SpecialImage table.

I want to get a row which shows the article and all the associated images from both other tables. An outer join seems restricted to only two tables.

I thought that maybe a UNION might help so that i could do the query for each part and then UNION to give the final result set

Any suggestions are most welcome.

regards
grant



Grant Sayer Received on Wed Aug 14 2002 - 06:22:48 CDT

Original text of this message

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