2013-01-18 140 views
0

不同我有一個表A中,除其他具有表B 的外鍵的字段我想獲取(標準API優選的,HQL行太)的 X條目有獨特的B參考,休眠標準通過結合表

任何想法?

回答

0
FROM A AS a 
WHERE a.b IN (SELECT ax.b 
       FROM A AS ax 
       GROUP BY b HAVING COUNT(b) = 1)