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

Re: SQL Question -Please help

From: Noel <noel_mckinney_at_ieee.org>
Date: Fri, 10 Nov 2000 18:47:02 -0600
Message-ID: <8ui4pv$et2$1@slb2.atl.mindspring.net>

Hubert <hubertg_at_gmx.net> wrote in message news:3A0C798D.7B84FB77_at_gmx.net...
> Hi!
>
> I have a question:
>
> I have to tables A and B
>
> A
> ---
> attr2
> ----
> x
> y
>
>
> B
> ----------
> attr1 attr2
> ----------
> 1 x
> 1 y
> 2 x
> 3 x
>
> result should be
>
> attr1
> ----------
> 1
>
> because 1 has fulfills the condition that for all the tupels in A there
> is a
> corresponding tupel in B. There is 1-x and 1-y, x and y are in A -> so
> in the result table there is only 1, 2 and 3 don't have a tupel with all
> the values
> of A (x and y).
>
> Hope someone could follow my problem-description, sorry for my English
> and thanks for help.
>
> Bye
> Hubert
> hubertg_at_gmx.net
>

Hubert,

What you are doing in your example is dividing table B by table A in relational algebra terms. What you want to do logically when applying this to SQL is "select attr1 from B such that there does not exist an attr2 in A that attr1 in B does not have."

Noel Received on Fri Nov 10 2000 - 18:47:02 CST

Original text of this message

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