Re: query question

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: query question
Дата
Msg-id 23206.1316617878@sss.pgh.pa.us
обсуждение исходный текст
Ответ на query question  (pg noob <pgnube@gmail.com>)
Список pgsql-novice
pg noob <pgnube@gmail.com> writes:
> Is there an efficient way to select the set of rows which have the max
> values across multiple columns?

I think SELECT DISTINCT ON might help you.  The idea is to sort the rows
in an appropriate order then take the first row from each group.  Look
at the "weather reports" example in PG's SELECT reference page for
inspiration.

            regards, tom lane

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

Предыдущее
От: Asli Akarsakarya
Дата:
Сообщение: a spatial table's bounding box
Следующее
От: e-letter
Дата:
Сообщение: ERROR: invalid input syntax for integer: