我有一个表,如下所示:如何按降序对单个行进行排序?
Name LastName tPoints aPoints sPoints gPoints type
John Johnny 15 14 13 10 1
Joe P. 12 11 26 10 1
Matt Q. 11 26 37 44 2
Sorine P. 55 9 8 7 2
Ali Ahmed 30 44 88 65 2
... ... .. .. .. .. 3
3
我想显示根据各行进行排序,并TYPE
注:i can't use order by in oracle because it sorts only 1 row and the others is sorted based on the first row
我不想打破将表分成单独的表,然后对其进行排序,然后将其更新回原始表。
因此,输出将看起来像这样,对于tPoints
- 我需要显示所有
15 - John Johnny
12 - Joe P.
和aPoints
44 - Ali Ahmed
26 - Matt Q.
9 - Sorine P.
等等...
简而言之,如果type = 1,则按降序排序tPoints,如果type = 2,则排序aPoints,如果type = 3,则排序s点,等等......
什么将是一个有效的方法来韭菜?
Regards,
行或列?你能给我们一个具体的例子吗? – Will
只需将其导出为excel,然后重新排列它即可。 –
@nathanhayfield这是一个存储过程,不可能,但是谢谢 – user1683987