Does hibernate HQL queries support using select min, max, count and other sql functions?
like:
select min(p.age) from person p
Thanks
Keywords like SELECT, FROM, and WHERE, etc., are not case sensitive, but properties like table and column names are case sensitive in HQL.
Hibernate Query Language (HQL) supports the following aggregate functions in SELECT statements. Except count() , all other functions except numeric values as arguments. The count() can be used to count any kind of values, including the number of rows in the query result.
Yes, min()
, max()
and count()
are supported in HQL.
see aggregate functions in the Hibernate Doc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With