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