ROW_NUMBER
select employeeId salary row_number() over(order by salary desc) as rank
from employee;
此语句会帮我们另起一行为rank,而且按照顺序排好序,类似(1,2,3,4...)
RANK
select employeeId salary rank() over(order by salary desc) as rank
from employee;
同上,区别在于顺序是类似(1,1,3,4,4,4,7...)
DENSE_RANK
select employeeId salary dense_rank() over(order by salary desc) as rank
from employee;
同上,区别在于顺序类似(1,1,2,3,3,4,4,4,5...)
NTILE
PERCENT_RANK
.
标签:salary,...,函数,over,rank,MySQL,select,employeeId From: https://www.cnblogs.com/happy12123/p/16855476.html