select name,count(1) as 次数 from 表 group by name order by count(1) desc

解决方案 »

  1.   

    select * from 
    (select name,count(1) as 次数 from 表 group by name) a
    where (select count(1) from (select name,count(1) as 次数 from 表 group by name) b
     where b.name=a.name and b.次数<=a.次数) between 1 and 10
      

  2.   

    select a.name 
    from (
    select top 10 name,count(1) as 次数 
    from 表 
    group by name 
    order by count(1) desc ) a
      

  3.   

    select name,count(*) as times
    from tablename
    group by name
    order by count(*) desc
      

  4.   

    select * from 
    (select name,count(1) as 次数 from 表 group by name) a
    where (select count(1) from (select name,count(1) as 次数 from 表 group by name) b
     where b.name=a.name and b.次数<=a.次数) between 1 and 10
    order by a.次数 desc
      

  5.   

    select a.名字
    from (
    select top 10 name,count(1) as 次数 
    from 表 
    group by name 
    order by count(1) desc ) a
      

  6.   

    select a.name 
    from (
    select top 10 name,count(1) as 次数 
    from 表 
    group by name 
    order by count(1) desc ) a
    order by a.次数 desc