我得到了这样的 SQL 查询:
SELECT COUNT(count) as ovcount from (SELECT COUNT(id) AS count FROM table WHERE
field1=value1 and field2=value2 GROUP BY something1, something2, something3)
as T WHERE count > 1
该语句在 HQL 中的外观如何?如果查询在 FROM 之后包含子查询,Hibernate 不支持“简单方法”。