Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Outer join problem
Hi,
What you want is :
Some rows of A who have a description (from B)
AND
Some rows of A who have no description
That's typically a UNION, so try this :
SELECT a.seqid, b.description, a.numerical_column
from a, b
where a.catid=b.catid /* have a description in B */
and a.seqid='12345'
UNION
SELECT a.seqid, 'NO DESC.' description, a.numerical_column
from a, b
where a.seqid='12345'
and not exists (select null from b /* have no description in B */
where b.catid=a.catid)order by 2
--
Pierre CHARPENAY
Received on Wed Feb 09 2000 - 06:30:50 CST
![]() |
![]() |