NULLIF
If value1 and value2 are equal, the function NULLIF returns the null value, otherwise it returns value1.
NULLIF(value1, value2)
Example:
create table test(id int, math int);
insert into test values(1,88),(2,89),(3,100),(4,99);
select nullif(math, 100) from test;
NULLIF
----------------
88
89
99
(4 rows)
Top comments (0)