public inbox for [email protected]
help / color / mirror / Atom feedFrom: Bruno Wolff III <[email protected]>
To: [email protected]
Subject: Can any_value be used like first_value in an aggregate?
Date: Tue, 25 Jun 2024 11:42:08 -0500
Message-ID: <[email protected]> (raw)
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.
view thread (4+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected]
Subject: Re: Can any_value be used like first_value in an aggregate?
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox