Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Outer join problem
Hi,
I *know* I should be able to figure this out but my brain hurts!!!
I have 2 tables in a database, A and B.
Table A has columns called DistID (PK), SeqID (an FK from another table, C), CatID (FK from table B) and numerical_column. Table B has 2 columns: CatID (PK) and a description column.
I thought that my query would look like this:
SELECT a.seqid, b.description, a.numerical_column
from a, b
where a.catid(+)=b.catid
and a.seqid='12345'
order by b.description
/
because I want the query to return the amount in the numerical column as null if the catID isn't present in table A, together with the rest of the query results.
Does this make sense. I was sure that an outer join should work?! Or do I need to use a UNION statement instead?
Thanks,
Sarah
Received on Tue Feb 08 2000 - 07:36:57 CST