9.2. WITHIN GROUP Clause for Aggregate Functions

The WITHIN GROUP clause is used for a subset of aggregate function to define an order within the group for their operation or processing.

Syntax

<within-group-specification> ::=
  WITHIN GROUP '(' ORDER BY <sort-specification-list> ')'
 
<sort-specification-list> ::=
  !! See ORDER BY syntax !!

The inverse distribution functions only accept a single sort-specification.