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

SQL Anywhere 11.0.0 » SQL Anywhere Server - SQL Reference » Using SQL » SQL functions » Alphabetical list of functions


ISNULL function [Miscellaneous]

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

ISNULL( expression, expression [, ...] )
  • expression   An expression to be tested against NULL.

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


The return type for this function depends on the expressions specified. That is, when the database server evaluates the function, it first searches for a data type in which all of the expressions can be compared. When found, the database server compares the expressions and then returns the result (the first non-NULL expression) in the type used for the comparison. If the database server cannot find a common comparison type, an error is returned.

See also
Standards and compatibility
  • SQL/2003   Vendor extension.


The following statement returns the value -66.

SELECT ISNULL( NULL ,-66, 55, 45, NULL, 16 );