Subject Re: [IBO] How to set up self refer table
Author Steve Fields
"Daniel L. Miller" wrote:
>
> This is a self refering table by way of the SUPERV
> field.
>
> select P1.PIN, P1.LASTNAME, P1.SUPERV, P2.LASTNAME SUPER_LASTNAME
> from PEOPLE P1 left join PEOPLE P2 on P1.SUPERV=P2.PIN
>
> or
>
> select PIN, LASTNAME, SUPERV,
> (SELECT LASTNAME FROM PEOPLE P2 WHERE P2.PIN=P1.SUPERV) SUPER_LASTNAME
> from PEOPLE P1
>
> Daniel
>
> [Non-text portions of this message have been removed]
>
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

Works perfect. (Only difference I saw from
my different trys was to alias the P2.LASTNAME
to SUPER_LASTNAME)

Thanks!
Steve Fields