NULLIF(expr1,expr2)
Returns NULL if expr1 = expr2 is true, otherwise returns expr1. This is the same as CASE WHEN expr1 = expr2 THEN NULL ELSE expr1 END.
SELECT NULLIF(1,1); +-------------+ | NULLIF(1,1) | +-------------+ | NULL | +-------------+ SELECT NULLIF(1,2); +-------------+ | NULLIF(1,2) | +-------------+ | 1 | +-------------+
© 2019 MariaDB
Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.
https://mariadb.com/kb/en/nullif/