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

Home -> Community -> Usenet -> c.d.o.misc -> Re: AND or UNION

Re: AND or UNION

From: Wong Chung Yin <cscywong_at_ug.cs.ust.hk>
Date: 1997/02/14
Message-ID: <5e1cr3$klb@ustsu10.ust.hk>#1/1

Mark Rosenbaum (mjr_at_netcom.com) wrote:
: >: Which one is more efficient?
: > 1. select * from empdemo where empdemo = 0 or empdemo = 1;
: >
: >: 2. select * from empdemo where empdemo = 0
: >: union
: >: select * from empdemo where empdemo = 1;
: >
 

: I believe that a union becomes a union all and then a sort to
: eliminate dups. Not only is the second query not going to give
: you the right answer it will be slow doing it. If you would

I don't know why the second query cannot give me the right answer. Could u mind explaining more detail? Received on Fri Feb 14 1997 - 00:00:00 CST

Original text of this message

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