Select b,d from aaa group by b,d having count(*) > 1

解决方案 »

  1.   

    select * from table_name,(select b,d count(*) as e from table_name group by b,d having e>1) T where table_name.b=T.b and table_name.d=T.d
      

  2.   

    若要查出所有字段
    Select t1.* from aaa t1
    join (
    Select b,d from aaa group by b,d having count(*) > 1
    ) t2 on t1.b = t2.b and t1.d = t2.d
      

  3.   

    select * from AAA 
    where b in (Select b from AAA group by b,d having count(*) > 1)
    and d in (Select d from AAA group by b,d having count(*) > 1)
      

  4.   

    select * from aaa c where exists ( select b,d from aaa d where c.b=d.b and c.d=d.d group by  b,d 
    having  count(b)>1 )