select * from (select aa,count(*) cnum from ls group by aa) where cnum>1;

解决方案 »

  1.   

    select aa,count(*) cnum from ls group by aa having count(*) > 1;===========================
    oldwain
    ---------------------------
    http://www.itpub.net/index.php?referrerid=32 
    http://www.linuxforum.net/ 
    http://expert.csdn.net/
    http://www.oraclefan.net/ 
      

  2.   

    很有道理,一定要先分组再筛选,不能用where,要不就成先筛选后分组了。
      

  3.   

    select * from vpfhs a where rowid<(select max(rowid) from vpfhs where vpf=a.vpf)
      

  4.   

    楼上 bzszp(SongZip)  的sql 语句执行出错
          oldwain(老斗)   方法没错
        fsb_12345(myself)  的语句可执行,但每一次求 max(rowid) 不理解,执行无效果。 
      

  5.   

    fsb_12345(myself)  的语句可执行,但每一次求 max(rowid) 不理解,执行无效果。这是个很有用的语句,一般用于删除重复记录delete from vpfhs a where rowid < (select max(rowid) from vpfhs where vpf=a.vpf);
      

  6.   

    有没有一句 把全部重复的记录的内容都列出来 类似于 select * from (select aa,count(*) cnum from ls group by aa) where cnum>1;
      

  7.   

    select aa,count(*) cnum from ls group by aa having count(*) > 1;
    老斗斗的对