select * from ypverify a where (select count(*) from ypverify b where a.barip=b.barip)>1

解决方案 »

  1.   

    不可能吧,一个barip对应有多个id,你要sql给你显示哪个ID好?
      

  2.   

    这样读取重复的
    select * from ypverify a where (select count(*) from ypverify b where a.barip=b.barip)>1
      

  3.   

    select * from ypverify  where id in(...) 也可以吗?
      

  4.   

    select * from ypverify a where (select count(*) from ypverify b where a.barip=b.barip)>1
    这个也不行呀
    它返回了所有barip为192.168.123.43的记录呀,
      

  5.   

    select * from ypverify  where id in(...) 也可以吗?
    可以,但是记录数量是不定的,这句要怎么写,
      

  6.   


    select barip,min(id) as id from sypverify group by barip或者 select barip,max(id) as id from sypverify group by barip
      

  7.   

    是不是csdn今天有问题,我给分为什么老是提交不成功?
      

  8.   

    其实可以用各种方法来处理,比如having count(*)>1
    select count(*),barip from sypverify group by barip having count(*)>1