I am using mysql function if
.
When I run SELECT IF(NULL, 2, 3)
I get 3
.
When the first parameter is NULL, by changing this SQL, can I get NULL?
P粉4500792662024-02-22 16:03:52
Use IF()
with ISNULL()
:
SELECT IF(ISNULL(NULL), 2, 3) -- output is 2