In SQL Server, PERCENTILE_DISC()
is a window function that returns a percentile value based on a discrete distribution of the input column. Basically, it returns the first value in the set whose ordered position is the same or more than the specified fraction.
The output of PERCENTILE_DISC()
is equal to a specific column value (unlike the PERCENTILE_CONT()
function, which could calculate a value that isn’t in the column).
When we call PERCENTILE_DISC()
we specify the percentile to use. It then performs its calculation based on that percentile.