select * from tb where code in(select code from tb group by code having count(1)>1)

解决方案 »

  1.   


    select * from tb where code in(select code from tb group by code having count(code)>1)
      

  2.   

    SELECT COUNT(1) as  , CODE 
    FROM TB 
    GROUP BY CODE HAVING(COUNT(1) > 1) 
      

  3.   

    select * from tb t where exists(select 1 from tb where code=t.code)
      

  4.   

    select * from tb where code in(select code from tb group by code having count(code)>1)