Re: efficient compare

From: Bob Badour <bbadour_at_pei.sympatico.ca>
Date: Fri, 21 Apr 2006 18:18:42 GMT
Message-ID: <6m92g.63775$VV4.1192573_at_ursa-nb00s0.nbnet.nb.ca>


lennart_at_kommunicera.umea.se wrote:

> -CELKO- wrote:
> [...]
>

>>SELECT *
>>  FROM A EXCEPT B;

>
> Shouldnt that be
>
> SELECT * FROM A
> EXCEPT
> SELECT * FROM B;
>
> ?

But what about the tuples in B that are not in A? In SQL terms:

SELECT * FROM ( SELECT * FROM A UNION SELECT * FROM B ) EXCEPT
SELECT * FROM ( SELECT * FROM A INTERSECT SELECT * FROM B ) But the OP wasn't asking how to express the query at the logical level--he already did that quite handily, himself. He asked quite specifically about physical implementation and efficiency. Received on Fri Apr 21 2006 - 20:18:42 CEST

Original text of this message