就2个字段 A 和 BA存号码 B存营业厅

解决方案 »

  1.   

    select A,B from (
    select A,B,row_number()over(partition by B order by A) as [order] from table1) T where T.[order]<201
    )
      

  2.   

    上一个有错,试一下:select A,B from (
    select A,B,row_number()over(partition by B order by A) as [order] from table1
    ) T
     where T.[order]<201
      

  3.   

    'row_number' 不是可以识别的 函数名。
      

  4.   

    select * from tb t
    where A in (select top 200 A from tb where B= t.B)
      

  5.   

    select * from tb t where (select count(1) from tb where b=t.b and a<=a.a)<=200