PERCENT_RANK()
This page is part of MariaDB's Documentation.
The parent of this page is: Functions for MariaDB Enterprise Server
Topics on this page:
Overview
A description for this Function has not yet been added to this Documentation.
EXAMPLES
CREATE TABLE t1 (a INT, b INT);
INSERT INTO t1 VALUES
(1,3), (1,5), (8,2), (5,7), (5,6),
(10,1), (6,4), (3,9), (3,9), (7,2),
(7,5), (2,6), (9,10), (9,5), (4,8);
SELECT a, b, PERCENT_RANK() OVER w AS 'percent_rank'
FROM t1 WINDOW w AS (ORDER BY a, b);
+------+------+--------------+
| a | b | percent_rank |
+------+------+--------------+
| 1 | 3 | 0.0000000000 |
| 1 | 5 | 0.0714285714 |
| 2 | 6 | 0.1428571429 |
| 3 | 9 | 0.2142857143 |
| 3 | 9 | 0.2142857143 |
| 4 | 8 | 0.3571428571 |
| 5 | 6 | 0.4285714286 |
| 5 | 7 | 0.5000000000 |
| 6 | 4 | 0.5714285714 |
| 7 | 2 | 0.6428571429 |
| 7 | 5 | 0.7142857143 |
| 8 | 2 | 0.7857142857 |
| 9 | 5 | 0.8571428571 |
| 9 | 10 | 0.9285714286 |
| 10 | 1 | 1.0000000000 |
+------+------+--------------+
CHANGE HISTORY
EXTERNAL REFERENCES
Additional information on this topic may be found in the MariaDB Public Knowledge Base.