How can distinct performance tiers get consecutive numbers?
DENSE_RANK increments once per new group of ordering values and shares its number among peers.
SQLite example and interpretation
Throughput scores 90,90,70 form tiers one, one and two. Tier numbers alone do not tell you how many models occupy each tier.
WITH x(v) AS (VALUES(90),(90),(70)) SELECT v,dense_rank() OVER(ORDER BY v DESC) FROM x ORDER BY v DESC;Result [[90, 1], [90, 1], [70, 2]]
中文
怎样给不同性能档位连续编号?
DENSE_RANK 每遇到一组新的排序键才增加一,组内记录共享编号。
SQLite 示例与适用条件
吞吐分值 90、90、70 得到两档 1、1、2。它适合标档位,无法告诉你每档里有多少模型。
WITH x(v) AS (VALUES(90),(90),(70)) SELECT v,dense_rank() OVER(ORDER BY v DESC) FROM x ORDER BY v DESC;结果 [[90, 1], [90, 1], [70, 2]]