题
你会怎么做使用JPA查询语言以下?
select * from person where email in
(select email from person group by email having count(email)>1)
解决方案
最后找到了解决方案:
select p from Person p
where p.email in (
select q.email
from Person q
group by q.email having count(q.email)>1)
order by p.email, p.id
其他提示
从此链接,还有的一般结构的解释一个JPA SELECT查询:
SELECT ... FROM ...
[WHERE ...]
[GROUP BY ... [HAVING ...]]
[ORDER BY ...]
不隶属于 StackOverflow