Re: problem query ...

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: problem query ...
Дата
Msg-id 3319.1012496541@sss.pgh.pa.us
обсуждение исходный текст
Ответ на problem query ...  (John Taylor <postgres@jtresponse.co.uk>)
Список pgsql-novice
John Taylor <postgres@jtresponse.co.uk> writes:
> I want to return 1 row for each id, that contains the maximum update
> value for that id, and the values for name and desc.

There's no simple way to do that in standard SQL.  However you can do
it easily with SELECT DISTINCT ON, if you don't mind using a nonstandard
construct.  See the "weather report" example on the SELECT reference
page.

            regards, tom lane

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

Предыдущее
От: Chris Thompson
Дата:
Сообщение: Re: column headers all in upper-case letters?
Следующее
От: Frank Bax
Дата:
Сообщение: Re: problem query ...