Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: OR Vs UNION
SET TIMING ON
SET AUTOTRACE TRACEONLY
>----- ------- 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
>/
>
>
>--
>Please see the official ORACLE-L FAQ:
>http://www.orafaq.net
>--
>Author:
> INET: [EMAIL PROTECTED]
>
>Fat City Network Services -- 858-538-5051
>http://www.fatcity.com
>San Diego, California -- Mailing list and
>web hosting services
>To REMOVE yourself from this mailing list, send an
>E-Mail message
>to: [EMAIL PROTECTED] (note EXACT spelling of
>'ListGuru') and in
>the message BODY, include a line containing: UNSUB
>ORACLE-L
>(or the name of mailing list you want to be removed
>from). You may
>also send the HELP command for other information
>(like subscribing).
>---------------------------------------------------
>------------------
Regards,
Stephane Faroult
Oriole
-- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Stephane Faroult INET: [EMAIL PROTECTED] Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Tue Jun 24 2003 - 08:40:41 CDT