Skip to content
masterclass Buddy

PostgreSQL · Function

coalesce

COALESCE returns the first argument that is not NULL. It returns NULL only when every argument is NULL.

Last updated

Syntax

COALESCE ( value [ , ... ] )

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • CASE
  • NULLIF
  • GREATEST
  • LEAST

Source: PostgreSQL: Documentation: 18: 9.18. Conditional Expressions. Checked 2026-11-03.