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

Home -> Community -> Mailing Lists -> Oracle-L -> Need another pair(s) of eyes

Need another pair(s) of eyes

From: Wolfgang Breitling <breitliw_at_centrexcc.com>
Date: Thu, 26 Jul 2007 04:21:47 -0600
Message-Id: <20070726102103.019DD717489@turing.freelists.org>


Hi,

or probably more accurately a few more brains.

I think the following are equivalent:

do something (select, update, delete)
where < some predicates>
and exists ( select 'x' from tableA, tableB

   where < some regular predicates > and < some correlated predicates >    UNION ALL
   select 'x' from tableC, tableD (could be same as A and/or B)    where < some regular predicates > and < some correlated predicates >
)

and

do something (select, update, delete)
where < some predicates>
and ( exists ( select 'x' from tableA, tableB

   where < some regular predicates > and < some correlated predicates > )    OR exists (
   select 'x' from tableC, tableD (could be same as A and/or B)    where < some regular predicates > and < some correlated predicates > )
)

Likewise for not exists:

do something (select, update, delete)
where < some predicates>
and not exists ( select 'x' from tableA, tableB

   where < some regular predicates > and < some correlated predicates >    UNION ALL
   select 'x' from tableC, tableD (could be same as A and/or B)    where < some regular predicates > and < some correlated predicates >
)

vs.

do something (select, update, delete)
where < some predicates>
and not exists ( select 'x' from tableA, tableB

   where < some regular predicates > and < some correlated predicates > )    AND not exists (
   select 'x' from tableC, tableD (could be same as A and/or B)    where < some regular predicates > and < some correlated predicates > )

Can someone think of some condition(s), examples where they would not be equivalent?

Regards

Wolfgang Breitling
Centrex Consulting Corporation
www.centrexcc.com
AIM: WBreitling

--
http://www.freelists.org/webpage/oracle-l
Received on Thu Jul 26 2007 - 05:21:47 CDT

Original text of this message

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