Re: Ambiguous columns

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Ambiguous columns
Дата
Msg-id 4673.1120406841@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Ambiguous columns  (Steve Tucknott <steve@retsol.co.uk>)
Ответы Re: Ambiguous columns
Список pgsql-novice
Steve Tucknott <steve@retsol.co.uk> writes:
> If I have two tables(taba, tabb) with the same column (column1) name and
> try to do:

> SELECT taba.column1 AS column1,tabb.column2 AS column2
>     FROM taba AS a
>          JOIN tabb AS b
>          ON  taba.indexCol = tabb.indexCol
> GROUP BY column1

> It tells me that column1 is ambiguous. Is that to be expected?

Yes.

> I thought you could only only group on selected fields,

No, that's never been true.  You're confusing it with ORDER BY,
which has different rules.

            regards, tom lane

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

Предыдущее
От: Andreas Kretschmer
Дата:
Сообщение: Re: [despammed] Ambiguous columns
Следующее
От: Bruno Wolff III
Дата:
Сообщение: Re: Ambiguous columns