Hibernate – Multiple columns in group by clause in hibernate

group-byhibernate

How to do Group by query (for e.g. Select column1,column2,min(value) from Foo_Bar where value> 100 group by (Column1,Column2) ) in hibernate? I wanted to have multiple columns in group by part.

Best Answer

select f.column1, f.column2, min(f.value)
from FooBar f
where f.value > 100
group by f.column1, f.column2