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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: OR Vs UNION

RE: OR Vs UNION

From: Jamadagni, Rajendra <Rajendra.Jamadagni_at_espn.com>
Date: Tue, 24 Jun 2003 07:25:49 -0700
Message-ID: <F001.005B866E.20030624070953@fatcity.com>

I believe OR is internally transformed to UNION (or UNION ALL) ??

The answer you are looking is ... test and measure it in _your_ _environment_.

Raj



Rajendra dot Jamadagni at nospamespn dot com All Views expressed in this email are strictly personal. QOTD: Any clod can have facts, having an opinion is an art !

>----- ------- Original Message ------- -----
>From: [EMAIL PROTECTED]
>To: Multiple recipients of list ORACLE-L
><[EMAIL PROTECTED]>
>Sent: Mon, 23 Jun 2003 21:34:52
>
>
>
>
>
>Hi All,
>
>Could someone explain to me which one is best in
>the following two queries
>w.r.t performance?
>
>Thanks
>Sami
>
>Query1)
>========
>select distinct empployee_id from employees where
>department_id=10 or
>department_id=20
>/
>
>Query2)
>=======
>select employee_id from employees where
>department_id=10
>union
>select employee_id from employees where
>department_id=20
>/
>

*********************************************************************This e-mail 
message is confidential, intended only for the named recipient(s) above and may contain information that is privileged, attorney work product or exempt from disclosure under applicable law. If you have received this message in error, or are not the named recipient(s), please immediately notify corporate MIS at (860) 766-2000 and delete this e-mail message from your computer, Thank
you.*********************************************************************1
Received on Tue Jun 24 2003 - 09:25:49 CDT

Original text of this message

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