CUME_DIST Function Example | VantageCloud Lake - Example: CUME_DIST Function - Teradata VantageCloud Lake

Lake - Working with SQL

Deployment
VantageCloud
Edition
Lake
Product
Teradata VantageCloud Lake
Release Number
Published
February 2025
ft:locale
en-US
ft:lastEdition
2025-11-21
dita:mapPath
jbe1714339405530.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
jbe1714339405530

The following SELECT statement:

SELECT lname, serviceyrs,
 CUME_DIST()OVER(ORDER BY serviceyrs)
 FROM schooltbl
 GROUP BY 1,2;

returns the cumulative distribution by service years for teachers listed in schooltbl.

lname serviceyrs CUME_DIST
Adams 10 0.333333
Peters 10 0.333333
Murray 10 0.333333
Rogers 15 0.444333
Franklin 16 0.555333
Smith 20 0.888889
Ford 20 0.888889
Derby 20 0.888889
Baker 20 1.000000