select * from t a
where exists(select 1 from t where col1=a.col1 and col2=a.col2)

解决方案 »

  1.   

    上面错了
    select * from t a
    where (select count(*) from t where col1=a.col1 and col2=a.col2)>1
      

  2.   

    select 字段2,字段3 from tb a,
    (select 字段2,字段3 from tb group by 字段2,字段3 having count(*)>1)b
    where a.字段2=b.字段2 and a.字段3=b.字段3