select * from t1 where f1=f2

解决方案 »

  1.   

    select * from t1 a where exists ( select f1 from t1 b where a.f1=b.f1 and a.f2=b.f2 group by f1,f2 having count(*)>1)
      

  2.   

    --如果是找出f1+f2重复的记录,就用:select a.* from t1 a join(
    select f1,f2 from t1 group by f1,f2 having count(*)>1
    )b on a.f1=b.f1 and a.f2=b.f2