Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: AND or UNION
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
![]() |
![]() |