PERCENTILE_DISC

PERCENTILE_DISC is an inverse distribution function that assumes a discrete distribution model. It takes a percentile value and a sort specification and returns an element from the set.

Syntax

PERCENTILE_DISC (expression) WITHIN GROUP (ORDER BY expression [ ASC | DESC ] [ NULLS { FIRST | LAST } ] [, ...] ) OVER (PARTITION BY expression [, ...] )

Remarks

Nulls are ignored in the calculation.
PARTITION BY is required if an OVER clause is used.
Without an OVER clause, PERCENTILE_DISC is a simple aggregate function.Refer Window Clause