NULLIF compares two expression provided within it and returns null if it is equal otherwise the first expression is returned.
Syntax
NULLIF(exp1, exp2)
Example
We will be playing around with the emp table here.
We will try to make null those who has office code 772.
select * , nullif (officeCode, 772) as Fired from emp;
So this is how we can play around with NULLIF function.
Fri, 07/01/2022 - 13:33
Comments