NULLIF (exp1, exp2)
Since the second row contains the NULL value, 'foo' is substituted in its place.
SELECT IFNULL(col1, 'foo') FROM Demo
This results in three rows fetched from one column:
3 rows fetched from 1 column.
The first row contains ‘abc,’ which matches the second argument of the following NULLIF call.
SELECT NULLIF(col1, 'abc') FROM Demo
A NULL is returned in its place: