Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » SQL Anywhere Server - SQL Reference » SQL Functions » Alphabetical list of functions

CHAR_LENGTH function [String] Next Page

COALESCE function [Miscellaneous]


Returns the first non-NULL expression from a list. This function is identical to the ISNULL function.

Syntax

COALESCE( expression, expression [ , ...] )

Parameters

expression    Any expression.

At least two expressions must be passed into the function, and all expressions must be comparable.

Remarks

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

The parameters can be of any scalar type, but not necessarily same type.

For a more detailed description of how the database server processes this function, see ISNULL function [Miscellaneous].

See also
Standards and compatibility
Example

The following statement returns the value 34.

SELECT COALESCE( NULL, 34, 13, 0 );