这个我就用语言表述吧。我是一个下载站。
有很多软件的名字重复,但有的名字重复,只是同一个名称但又不是同一个版本。能不能写一条语句,把名字和版本都重复的列出来。

解决方案 »

  1.   


    select 名字,版本
    from 表
    group by 名字,版本
    having count(*)>1 
      

  2.   

    select 
      *
    from 
      tb t
    where
      (select count(1) from tb where 名字=t.名字 and 版本=t.版本)>1
      

  3.   


    老大,我一运行这个,CPU就100%了,我晕。
      

  4.   

    数据量很大,试试这个--select 
      a.*
    from 
      tb a,
      (select 名字,版本 from tb group by 名字,版本 having count(1)>1) b
    where
      a.名字=b.名字 and a.版本=b.版本