|Oracle8i SQL Reference
Release 2 (8.1.6)
Functions, 71 of 121
For information on syntax and semantics, see "Analytic Functions".
RATIO_TO_REPORT is an analytic function. It computes the ratio of a value to the sum of a set of values. If expr evaluates to null, the ratio-to-report value also evaluates to null.
The set of values is determined by the query_partition_clause. If you omit that clause, the ratio-to-report is computed over all rows returned by the query.
The following example calculates the ratio-to-report of each salesperson's salary to the total of all salespeople's salaries: