select * from t1 a where f1 in (select f1 from t1 group by f1 having count(f1)>1)

解决方案 »

  1.   

    select * from t1 a where f1 in (select f1 from t1 group by f1 having count(f1)>1)
      

  2.   

    select * from t1 a 
    where f1 in (select f1 from t1 group by f1 having count(*)>1)
    order by f2
      

  3.   

    select t1.* from t1 right  join
    (select f1 from t1 group by f1 having count(f1) > 1 ) as t2
    on t1.f1=t2.f1 order by t1.f1,t1.f2
      

  4.   

    select * from t1 where f1 in (select f1 from t1 group by f1 having sum(1)>1)
      

  5.   

    table: t1
    f1 f2          f3
    2 10           1
    3 9            1
    5 13           1
    6 11           1
    3 11           1
    5 8            1
    7 9            1
    3 8            2请问如何选择出f1有相同的并且f3为1的呢?
    比如上面的就选择出f1 f2
    3 9
    3 11
    5 8
    5 13谢谢~~
      

  6.   

    select * from t1 where f1 in (select f1 from t1 group by f1 having sum(1)>1)