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

Home -> Community -> Usenet -> c.d.o.tools -> Re: SQL Question-Please help (follow up)

Re: SQL Question-Please help (follow up)

From: Hubert <hubertg_at_gmx.net>
Date: Sat, 11 Nov 2000 13:07:00 +0100
Message-ID: <3A0D3664.F51836BE@gmx.net>

Thank you very much!
I knew that this is called division in relational algebra, but I didn't find an example for this in SQL.

Thanks again, bye
Hubert

Noel schrieb:

> Hubert,
>
> Following up my own reply (had to leave for dinner) on what I said earlier
> about dividing the two tables, if your question involves the SQL statement
> for your query, it would look like this:
>
> SELECT attr1
> FROM b b1
> WHERE NOT EXISTS
> (SELECT *
> FROM a
> WHERE NOT EXISTS
> (SELECT *
> FROM b b2
> WHERE b1.attr1 = b2.attr1
> AND a.attr2 = b2.attr2));
>
> You can see now why 'not' appears twice in "select attr1 from B such that
> there does not exist an attr2 in A that attr1 in B does not have."
>
> Noel
Received on Sat Nov 11 2000 - 06:07:00 CST

Original text of this message

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