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 -> Re: and / where

Re: and / where

From: Maxim Demenko <mdemenko_at_gmail.com>
Date: Wed, 06 Dec 2006 19:58:46 +0100
Message-ID: <457712E6.1060000@gmail.com>


Ed Prochak schrieb:
> BigLearner wrote:
>
> If you are joining tables on more than one column, then you can have
> AND in the JOIN also
>
> SELECT *
> FROM a JOIN b ON a.group=b.grpid AND a.lastname=b.grpname
> WHERE a.start = sysdate AND b.rank>12 ;
>
> It is like the style choice of writing a FOR loop or a WHILE loop.
>

For *outer joins* the difference however may be not so subtle. Consider

select ename,job,dname
from emp e
right outer join
dept d on e.deptno = d.deptno
where dname is not null
and e.job='CLERK';

against

select ename,job,dname
from emp e
right outer join
dept d on e.deptno = d.deptno and e.job='CLERK' where dname is not null;

Best regards

Maxim Received on Wed Dec 06 2006 - 12:58:46 CST

Original text of this message

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