If you’re getting error message 4112 that reads “The function ‘CUME_DIST’ must have an OVER clause with ORDER BY” when using the CUME_DIST()
function, it’s probably because you’re omitting the ORDER BY
clause from the OVER
clause.
When using the CUME_DIST()
function in SQL Server, we must include an OVER
clause that contains an ORDER BY
clause. This error happens when we provide the OVER
clause but not the ORDER BY
clause.
To fix this error, add an ORDER BY
clause to the OVER
clause.