The supported aggregate functions are:
avg(...), sum(...), min(...), max(...) count(*)
count(...), count(distinct ...), count(all...)
We can see that HQL queries can even return the results of aggregate functions on properties:
Example for this we can take:
select avg(student.weight), sum(student.weight), max(student.weight), count(student)
from Student student
we can use arithmetic operators, concatenation, and recognized SQL functions in the select clause:
select cat.weight + sum(kitten.weight) from Student student join student.kittens kitten
group by cat.id, student.weight
select firstName||' '||initial||' '||upper(lastName) from Person
The distinct and all keywords can be used and have the same semantics as in SQL.
select distinct cat.name from Student student
select count(distinct student.name), count(cat) from Student student