Can any_value be used like first_value in an aggregate?

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Can any_value be used like first_value in an aggregate?
Дата
Msg-id 20240625164208.GA1043@wolff.to
обсуждение исходный текст
Ответы Re: Can any_value be used like first_value in an aggregate?
Список pgsql-general
For example, is output of 10 guaranteed in the following:
bruno=> select any_value(x order by x desc) from generate_series(1,10) as x;
 any_value 
-----------
        10
(1 row)

The use case is that I want to return a value of one column that is paired 
with the maximum value of another column in each group when using GROUP BY.

(There aren't going to be any NULLs in the involved columns.)

Thanks.



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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Postgresql python in upgraded version 16.2
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Can any_value be used like first_value in an aggregate?