Use the following expression:

PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY enter your named list here)


Example: find the median publication date from a list of publication dates.

PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY recs.year_of_publication::integer)

  • No labels