CUME_DIST Function Syntax | VantageCloud Lake - CUME_DIST Function Syntax - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
Language
English (United States)
Last Update
2024-04-03
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905
CUME_DIST() OVER (
  [ PARTITION BY column_reference [,...] ] 
  ORDER BY value_spec [,...]
  [ RESET WHEN condition ]
)

Syntax Elements

OVER
Specifies how values are grouped, ordered, and considered when computing the cumulative, group, or moving function.
Values are grouped according to the PARTITION BY BEGIN and RESET WHEN clauses END, sorted according to the ORDER BY clause, and considered according to the aggregation group within the partition.
PARTITION BY column_reference [,...]
The group or groups over which the function operates.
If there is no PARTITION BY or RESET WHEN clauses, then the entire result set, delivered by the FROM clause, constitutes a partition.
PARTITION BY clause is also called the window partition clause.
ORDER BY value_spec [,...]
value_expression [ ASC | DESC ] [ NULLS { FIRST | LAST } ]
The order in which the values in a group or partition are sorted.
RESET WHEN condition
A conditional expression used to determine conditional partitioning. The condition in the RESET WHEN clause is equivalent in scope to the condition in a QUALIFY clause with the additional constraint that nested ordered analytical functions cannot specify a RESET WHEN clause. Also, you cannot specify SELECT as a nested subquery within the condition.
The condition is applied to the rows in all designated window partitions to create sub-partitions within the window partitions.
For more information, see RESET WHEN Condition Rules and QUALIFY Clause.
ASC
Results are to be ordered in ascending sort order.
If the sort field is a character string, the system orders the field in ascending order according to the definition of the collation sequence for the current session.
The default order is ASC.
DESC
Results are to be ordered in descending sort order.
If the sort field is a character string, the system orders the field in descending order according to the definition of the collation sequence for the current session.
NULLS FIRST
NULL results are to be listed first.
NULLS LAST
NULL results are to be listed last.