Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: OR Vs UNION
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
>----- ------- 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-mailmessage 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.*********************************************************************1Received on Tue Jun 24 2003 - 09:25:49 CDT