ISNULL (exp, value)

Replaces NULL with the value specified for value. Exp is the expression to check for NULL. Value is the value returned if exp is NULL. Exp is returned if it is not NULL. The data type of value must be compatible with the data type of exp.

SELECT c1, c2, ISNULL(c1, 1000), ISNULL(C2, 'a string') from t8

The SELECT returns 100 and string1 because both c1 and c2 contain a value, not a NULL.

Thursday, 18 April 2019 Posted in Logical Functions