求用一句sql server对一下结果进行排序,麻烦各位大虾
insert into (eo,jo,po) values('A','2',6),下面类同。就是eo字段为char jo为char po为int
A 2 6
A 2 5
A 8 9
A 5 3
B 6 7
B 6 8
B 4 9
B 3 23
C 4 3
C 2 32
C 1 34
C 7 21
最后的结果为
A 8 9
A 2 6
B 3 23
B 4 9
C 1 34
C 2 32
求一句sql server语句对上面的字段排序成为上面的结果。麻烦各位大虾了
------解决方案--------------------
SQL code
select * from
SEELCT (row_number() over(partition by eo order by po desc)) numberid ,eo,jo,po from tb ) z
where numberid <=2