Re: Select problem

Поиск
Список
Период
Сортировка
От Chris Ryan
Тема Re: Select problem
Дата
Msg-id 399811D8.3A5EA78A@greatbridge.com
обсуждение исходный текст
Ответ на Select problem  ("Karl F. Larsen" <k5di@zianet.com>)
Список pgsql-novice
since armycall is a field in both tables postgres doesn't know which one
you are talking about. So in instances like these you have to fully
qualify the field name. i.e. data.armycall or biglist.armycall. Your
choice as in this instance the data will be the same. So the final query
should look like

    select user, data.armycall
        from data, biglist
        where user.armycall = biglist armycall

As a general rule when i join tables I ussually qualify all the fields
in the query to make it clear as that what fields i trully want.

hope this helps

Chris Ryan
chris@greatbridge.com



"Karl F. Larsen" wrote:
>
>         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?
>
> Yours Truly,
>
>          - Karl F. Larsen, k5di@arrl.net  (505) 524-3303  -

В списке pgsql-novice по дате отправления:

Предыдущее
От: patrick.wolf@Aerojet.com (WOLF, PATRICK)
Дата:
Сообщение: RE: Select problem
Следующее
От: NRonayette
Дата:
Сообщение: Re: Select problem