Re: Curious SQL question

From: J M Davitt <jdavitt_at_aeneas.net>
Date: Sat, 06 Jan 2007 09:22:30 GMT
Message-ID: <qTJnh.8313$ja6.2806_at_tornado.ohiordc.rr.com>


Neo wrote:

>>select distinct  orders.customer_id, products.product_id
>>          from orders, products
>>minus
>>select distinct customer_id, product_id
>>          from products;
>>
>>The first select esablishes a "universe of discourse"  for the query by
>>joining every customer with every product.  The second select excludes
>>products that a customer did buy.

>
>
> The above SQL makes the solution easy to understand (should the last
> line of the SQL be orders instead of products). Assuming the following:
>
> set A = {shampoo, soap, bread, wine}
> set B = {shampoo, soap, bread}
> set C = {wine}
>
> What is the most appropriate name of the function that does the
> following:
>
> C = f (A, B);
>
> Is it NAND, NOT INTERSECTION, NOT IN? And should the order of the
> inputs (A, B) matter?
>

Uh, isn't that 'A MINUS B' or, if you prefer, MINUS (A, B). Received on Sat Jan 06 2007 - 10:22:30 CET

Original text of this message