Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for min(Row[N]) and max(Row[N]) #9123

Open
lukaseder opened this issue Sep 2, 2019 · 3 comments
Open

Add support for min(Row[N]) and max(Row[N]) #9123

lukaseder opened this issue Sep 2, 2019 · 3 comments

Comments

@lukaseder
Copy link
Member

H2 seems to support MIN and MAX aggregate functions for row value expressions, which is a very useful feature (#9113 (comment)). They can be emulated.

  • In most RDBMS with ORDER BY .. LIMIT correlated subqueries, but that's quite difficult to get right.
  • In some RDBMS using ARRAY_AGG or COLLECT, which allows for ordering group elements, and accessing only the first element.
@katzyn
Copy link

katzyn commented Sep 2, 2019

You may want to suggest a FILTER clause to exclude nulls from aggregation, because row value with nulls will be aggregated otherwise.

@lukaseder
Copy link
Member Author

That might actually be the desired effect :) (Then we'll have to think about NULLS FIRST vs NULLS LAST semantics...)

@lukaseder
Copy link
Member Author

See also: See also: #11998

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants