Evaluate two expressions to determine their relationship.
SELECT NULLIF(25, 25); |
The NULLIF() function returns NULL if two expressions are identical; otherwise, it returns the first expression.
NULLIF(expr1, expr2) |
Parameter |
Description |
expr1, expr2 |
Mandatory. The pair of expressions that are to be evaluated for comparison. |
Works in: |
SQL Server (from 2008 onward), Azure SQL Database, Azure SQL Data Warehouse, and Parallel Data Warehouse |
Evaluate two expressions for comparison.
SELECT NULLIF(‘Hello’, ‘Hello’); |
Evaluate two expressions for comparison.
SELECT NULLIF(‘Hello’, ‘world’); |
Evaluate two expressions for comparison.
SELECT NULLIF(‘2017-08-25’, ‘2017-08-25’); |