2010-08-09 50 views

回答

7

終於找到了解決辦法:

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 
3

this link,有一個JPA SELECT查詢的一般結構的解釋:

SELECT ... FROM ... 
[WHERE ...] 
[GROUP BY ... [HAVING ...]] 
[ORDER BY ...]