Ranking Functions

Oracle has provided several functions for ranking rows. These functions will calculate rankings, percentiles, and n-tiles of the values. These functions are performed after the SELECT statement assembles the result set and prior to the ordering of the results.

There is an Oracle feature, PARTITIONS, that is used with analytic functions: This feature is totally unrelated to the physical partitioning of data stored within tables, which was discussed in Chapter 2. This partitioning occurs to only the result set of the SELECT statement and is not permanent. The feature allows the user to place into subsets the records that a SELECT statement returns. For example, assume that you would like to determine the top-two wage earners ...

Get Oracle SQL and PL/SQL Handbook: A Guide for Data Administrators, Developers, and Business Analysts now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.