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

Home -> Community -> Usenet -> c.d.o.misc -> Outer join problem

Outer join problem

From: s. hunter <sarahxhunter_at_NOSPAMTHANX.hotmail.com>
Date: Tue, 08 Feb 2000 14:36:57 +0100
Message-ID: <38A01BF8.E52365FD@NOSPAMTHANX.hotmail.com>


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

Original text of this message

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