select aa from table1
where bb in (select bb from table1 group by bb having count(bb)=1)
group by aa
having count(aa)>1
where bb in (select bb from table1 group by bb having count(bb)=1)
group by aa
having count(aa)>1
调试欢乐多
FROM table1 x
WHERE bb IN (SELECT bb FROM table WHERE aa = x.aa GROUP BY bb HAVING COUNT(bb) = 1)
GROUP BY aa
HAVING COUNT(aa) > 1