COALESCE() Function

Description of coalesce.eps follows

The COALESCE() function returns the first non-null value in a list.
The COALESCE function takes two or more compatible arguments and returns the first argument that is not null.

You must specify at least two expressions

If all occurrences of expr evaluate to null, then the function returns null.

The result is null only if all the arguments are null.

If all the parameters of the function call are dynamic, an error occurs.

Syntax:
COALESCE ( expression, expression [, expression]* )
The function must have at least two arguments.

COALESCE(expr1, expr2)

IS EQUIVALENT TO

CASE WHEN expr1 IS NOT NULL THEN expr1 ELSE expr2 END

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top