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

Home -> Community -> Usenet -> c.d.o.server -> Re: SQL Question

Re: SQL Question

From: Mark Gumbs <mgumbs_at_nospam.hotmail.com>
Date: Wed, 26 May 1999 11:06:35 +0100
Message-ID: <374bc56e.0@145.227.194.253>


The two statements in your instance are equivalent but bear in mind that when using the minus, the statemennt has to be in the correct order, ie tableA minus Tableb is not the same as tableB minus tableA.

Use set operators instead of the dreaded not in if you can, it should be faster.

Mark

Paul Davies wrote in message <374bb823_at_newsread3.dircon.co.uk>...
>Are intersects and joins equivalent?
>
>So is the query:
>
>select part from orders_list1
>intersect
>select part from orders_list2
>
>the same as
>
>select a.part from orders_list1 a, orders_list2 b where b.part = a.part
>
>Similarly is
>
>select part from orders_list1
>minus
>select part_from orders_list2
>
>the same as
>
>select part from orders_list1 where part not in (select part from
>orders_list2)
>
>If they are equivalent, when should one choose to use a set operator as
>opposed to a join or not in query?
>
>Help appreciated
>
>Paul
>
>
>
>
>
>
>
>
>
Received on Wed May 26 1999 - 05:06:35 CDT

Original text of this message

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