userid username province  email
1         sdfds       广东     [email protected] 
2         ssdffds     广东     [email protected] 
3         sdfsdfdds   湖南     [email protected] 
4         sdfds       湖南     [email protected] 
5         sdfds       山东     [email protected] 
5         sdfds       山东     [email protected]
5         sdfds       山西     [email protected]
.           .           .         .
.           .           .         .
.           .           .         .

解决方案 »

  1.   

    userid 有重复?
    5         sdfds       山东     [email protected] 
    5         sdfds       山东     [email protected]
    5         sdfds       山西     [email protected]?
      

  2.   

    select * from 会员表 a 
    where 
    (select count(*) from 会员表 where province = a.province and username > a.username) < 100 
      

  3.   

    --没测试过...lz看看行不行?
    --是在userid 没有重复的情况下使用
    select * 
    from userT a
    where userid in (select top 100 userid from userT where province =a.province order by userid  )