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: Stephane Faroult <sfaroult_at_oriolecorp.com>
Date: Tue, 24 Jun 2003 06:40:41 -0700
Message-ID: <F001.005B85BB.20030624054939@fatcity.com>


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

Original text of this message

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