How to get NULL from `SELECT IF(NULL, 2, 3)` MySQL method
P粉998920744
P粉998920744 2024-02-21 17:20:59
0
1
325

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粉998920744
P粉998920744

reply all(1)
P粉450079266

Use IF() with ISNULL():

SELECT IF(ISNULL(NULL), 2, 3)  -- output is 2
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template