Re: a sort-of key question

From: paul c <toledobythesea_at_oohay.moc>
Date: Sun, 20 Mar 2005 01:37:49 GMT
Message-ID: <Nt4%d.728651$Xk.338727_at_pd7tw3no>


Jan Hidders wrote:
> paul c wrote:
>

>> What are the last names of the people who share a last name with 
>> somebody else?
>>
>> Suppose the relation R is this:
>>
>> LAST      FIRST
>> _____      _____
>> Smith        Billy
>> Smith        Bobby
>> Jones        Nathan
>>
>> I'd expect the answer to be {Smith}.

>
>
> Let the relation be R(Last,First)
>
> S := RENAME[First->First2](R)
> T := R JOIN S // JOIN = the natural join
> U := SELECT[First<>First2](T)
> V := PROJECT[Last](U)
>
> -- Jan Hidders

thank you Jan, i don't know why i couldn't see that.

pc Received on Sun Mar 20 2005 - 02:37:49 CET

Original text of this message