Mega Code Archive

 
Categories / Oracle PLSQL Tutorial / Analytical Functions
 

Using the Ranking Functions

You use the ranking functions to calculate ranks, percentiles, and n-tiles. RANK() returns the rank of items in a group. RANK() leaves a gap in the sequence of rankings in the event of a tie. DENSE_RANK() returns the rank of items in a group. DENSE_RANK() doesn't leave a gap in the sequence of rankings in the event of a tie. CUME_DIST() returns the position of a specified value relative to a group of values. CUME_DIST() is short for cumulative distribution. PERCENT_RANK() returns the percent rank of a value relative to a group of values. NTILE() returns n-tiles: tertiles, quartiles, and so on. ROW_NUMBER() returns a number with each row in a group. Quote from: Oracle Database 10g SQL (Osborne ORACLE Press Series) (Paperback) # Paperback: 608 pages # Publisher: McGraw-Hill Osborne Media; 1st edition (February 20, 2004) # Language: English # ISBN-10: 0072229810 # ISBN-13: 978-0072229813