Search Postgresql Archives

Can any_value be used like first_value in an aggregate?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux