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

Home -> Community -> Usenet -> c.d.o.server -> Re: Are These 2 Statements Equal?

Re: Are These 2 Statements Equal?

From: <Kenneth>
Date: Tue, 01 Apr 2003 19:28:10 GMT
Message-ID: <3e89e4f3.8818580@news.inet.tele.dk>


They give the same result , even if there are NULL values in any of the subqueries (Always beware of NULLs when rewriting queries ).

On Tue, 01 Apr 2003 19:04:12 GMT, "Buck Turgidson" <jc_va_at_hotmail.com> wrote:

>I believe they are, but I would like another pair of eyes so I don't blow it
>and get fired since I am changing vendor code. The performance of my
>version (the 2nd) is far better than the first.
>
>
>DELETE FROM t
>WHERE TYPE IN (SELECT TYPE FROM x
> WHERE process_date = :1
> AND process_status = 'A')
>OR TYPE IN (SELECT TYPE FROM X2
> WHERE process_date <=:2
> AND process_status IN ('A','B'));
>
>
>-- the same as :
>
>DELETE FROM t
>WHERE TYPE IN (SELECT TYPE FROM x
> WHERE process_date = :1
> AND process_status = 'A'
> UNION
> SELECT TYPE FROM X2
> WHERE process_date <=:2
> AND process_status IN ('A','B'));
>
>
>
>
Received on Tue Apr 01 2003 - 13:28:10 CST

Original text of this message

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