select top 10 ID,USERNAME, TITLE, TIME
from  
(select *,row_number()oveer(partition by USERNAME order by ID) as cnt 
from table) As A
where cnt <=2
 order by TIME DESC 

解决方案 »

  1.   

    select  top 10 ID,USERNAME, TITLE, TIME 
    from  table  where  username    in  (select       username       from       table A       group       by       username       having       count(*)> 1) 
      

  2.   

    select top 10 * from tb t 
    where not exists(
    select * from tb where username=t.username and id<=t.id
    group by username having count(*)>2
    )把tb改成你的表名