首页 > 代码库 > Oracle 分数排名

Oracle 分数排名

--例子:5个100分的并排第一,3个90分的并列第二

select * from (select dense_rank() over (order by VEHICLE_SCORE desc ) RN,VIN,VEHICLE_SCORE
 from MAIN_VEHICLE where VEHICLE_SCORE IS NOT NULL)
where vin like ‘%EX046172%‘;

--例子:5个100分的并列第一,2个90分的并列第6

select * from (select rank() over (order by VEHICLE_SCORE desc ) RN,VIN,VEHICLE_SCORE
 from MAIN_VEHICLE where VEHICLE_SCORE IS NOT NULL)
where vin like ‘%EX046172%‘;

Oracle 分数排名