quartile

Returns the rank of a value, represented as integers from 1 (highest) to 4 (lowest), relative to a group of values.

Syntax

quartile ( numeric_expression [ tuple member_expression { ,
 member_expression } ] within set set_expression )