Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Select with dual-field empty
Sonnich wrote:
> Hi
>
> I havent touched oracle for some time...
>
> I want to do a select from 2 tables, where the connection between the
> tables are fields, but the row migth not exist
>
> e.g.
>
> select * from a, b where a.code=b.code(+), but like this:
>
> select * from a, b
> where a.code1=b.code1(+)
> and a.code2=b.code2(+)
>
> the point is that both code1 and 2 has to be there.
>
> Any idea how I can do this?
>
Maybe:
select * from a, b
where a.code1=b.code1(+)
and a.code2=b.code2(+)
AND (CODE1 IS NOT NULL AND CODE2 IS NOT NULL)
... maybe it could also be written with the explicit LEFT OUTER JOIN ..
ON syntax ...
cheers,
Martin
Received on Thu Oct 19 2006 - 14:39:48 CDT