Re: join problem or maybe group :(

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: join problem or maybe group :(
Дата
Msg-id 7597.1030635769@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: join problem or maybe group :(  ("Ben-Nes Michael" <miki@canaan.co.il>)
Список pgsql-general
"Ben-Nes Michael" <miki@canaan.co.il> writes:
> Just wonder, how can i do:
> select max(column1), column2 from table;
> its saying:
> ERROR:  Attribute table.column2 must be GROUPed or used in an aggregate
> function
> and all i want is that column2 value will be the mate fo column1 max?

You want DISTINCT ON ... see the weather-reports example on the SELECT
man page.

            regards, tom lane

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

Предыдущее
От: Patrick FICHE
Дата:
Сообщение: Re: join problem or maybe group :(
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Free space mapping (was Re: Multi-Versions and Vacuum)