Skip site navigation (1) Skip section navigation (2)

Re: Select problem

From: NRonayette <r97m10(at)socotec(dot)fr>
To: "Karl F(dot) Larsen" <k5di(at)zianet(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Select problem
Date: 2000-08-14 15:55:44
Message-ID: 39981680.1425B94B@socotec.fr (view raw or flat)
Thread:
Lists: 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.




In response to

pgsql-novice by date

Next:From: John McKownDate: 2000-08-14 16:35:29
Subject: Re: Select problem
Previous:From: WOLF, PATRICKDate: 2000-08-14 15:37:56
Subject: RE: Select problem

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group