Two SQL statements about generating ranks

xiaoxiao2021-03-06  17

Two SQL statements about generating ranks:

Select Name, Score, (Select Count (*) from T where score> a.score) 1

From t a

ORDER by SCORE

The above is: 1, 2, 3, 3, 3, 6, 7 ...

Here are: 1, 2, 3, 3, 3, 4, 5

Select Name, Score, (Select Count (Distinct Score) from T where score> a.score 1

From t a

ORDER by SCORE

转载请注明原文地址:https://www.9cbs.com/read-44804.html

New Post(0)