COALESCE Function [Miscellaneous]

Returns the first non-NULL expression from a list.

Syntax

COALESCEexpression, expression [ , … ] )

Parameters

Parameter

Description

expression

Any expression.

Returns

ANY

Example

The following statement returns the value 34:

SELECT COALESCE( NULL, 34, 13, 0 ) FROM iq_dummy

Standards and Compatibility

  • SQL—ISO/ANSI SQL compliant.

  • Sybase—Compatible with Adaptive Server Enterprise.

Related reference
ISNULL Function [Miscellaneous]