Returns a null value if the two specified expressions are equal. (MSDN)
Syntax:
NULLIF ( expression , expression )
Example:
SELECT NULLIF(id, '') FROM table
Result:
id若為空(''),則會呈現 NULL 型態
Replaces NULL with the specified replacement value. (MSDN)
Syntax:
ISNULL( check_expression , replacement_value )
Example:
SELECT ISNULL(id, '0') FROM table Result: id若為NULL,則會呈現0