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