hibernate中group by子句中的多个列

时间:2012-05-17 17:36:45

标签: hibernate group-by

如何在hibernate中按查询分组(例如,从Foo_Bar中选择column1,column2,min(value),其中值> 100 group by(Column1,Column2))?我希望在部分中有多列。

1 个答案:

答案 0 :(得分:10)

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