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

IDENTITY function [Miscellaneous] Next Page

IFNULL function [Miscellaneous]


Returns the first non NULL expression.

Syntax

IFNULL( expression-1, expression-2 [ , expression-3 ] )

Parameters

expression-1    The expression to be evaluated. Its value determines whether expression-2 or expression-3 is returned.

expression-2    The return value if expression-1 is NULL.

expression-3    The return value if expression-1 is not NULL.

Remarks

If the first expression is the NULL value, then the value of the second expression is returned. If the first expression is not NULL, the value of the third expression is returned. If the first expression is not NULL and there is no third expression, NULL is returned.

Standards and compatibility
Example

The following statement returns the value -66.

SELECT IFNULL( NULL, -66 );

The following statement returns NULL, because the first expression is not NULL and there is no third expression.

SELECT IFNULL( -66, -66 );