PERCENT_RANK : PERCENT_RANK « Analytical Functions « Oracle PL/SQL Tutorial






PERCENT_RANK will compute the cumulative fraction of the ranking that exists for a particular ranking value.

This calculation and the one for CUME_DIST are like the values one would see in a histogram.

PERCENT_RANK is set to compute so that the first row is zero, and the other values in this column are computed based on the formula:

Percent_rank (PR) = (Rank-1)/(Number of rows-1)

The CUME_RANK function calculates the cumulative distribution in a group of values.

If we have only one group, so the formula works like this:

Cumulative Distribution = the highest rank for that row (cr)/number of rows (nr)

Quote from:

Advanced SQL Functions in Oracle 10g (Wordware Applications Library)

(Paperback)

by Richard Earp (Author)

# Paperback: 350 pages

# Publisher: Wordware Publishing, Inc. (January 25, 2006)

# Language: English

# ISBN-10: 1598220217

# ISBN-13: 978-1598220216

16.6.PERCENT_RANK
16.6.1.PERCENT_RANK
16.6.2.Use PERCENT_RANK Function
16.6.3.PERCENT_RANK() calculates the percent rank of a value relative to a group of values.
16.6.4.Using the Hypothetical Rank and Distribution Functions