Re: Select problem - Mailing list pgsql-novice

From NRonayette
Subject Re: Select problem
Date
Msg-id 39981680.1425B94B@socotec.fr
Whole thread Raw
In response to Select problem  ("Karl F. Larsen" <k5di@zianet.com>)
List pgsql-novice
"Karl F. Larsen" a écrit :

>         I have a simple 3 table database with armycall as the common key
> and it all works fine when I doa select like so:
>
>         select user, doer
>         from data, biglist
>         where user.armycall = biglist.armycall;
>
> but if I want to get the column armycall and use:
>
>         select user, armycall
>         from data, biglist
>         where user.armycall = biglist.armycall
>
> I get an error that armycall is ambiguous.
>
>         Does anyone know how to correct this?

You must specify witch column you want in your select : data.armycall or
user.armycall (even if they are equal)

this give you something like this :
"
 select user, data.armycall
        from data, biglist
        where data.armycall = biglist.armycall
"
or
"
 select user, biglist.armycall
        from data, biglist
        where data.armycall = biglist.armycall
"

carefull, you made a mistake : "where user.armycall = biglist.armycall"
user is not a table but a column isn't it  ?


--
Workers of the world, arise!  You have nothing to lose but your chairs.




pgsql-novice by date:

Previous
From: Chris Ryan
Date:
Subject: Re: Select problem
Next
From: John McKown
Date:
Subject: Re: Select problem