類似於三元運算符 1) IF(where,result1,result2) = where?result1:result2 例如 SELECT IF(1=1,1,2) => 1 2) IFNULL(result1,result2) = result1 is not null?result1:resu ...
類似於三元運算符
1) IF(where,result1,result2) = where?result1:result2
例如 SELECT IF(1=1,1,2) => 1
2) IFNULL(result1,result2) = result1 is not null?result1:result2
例如 SELECT IF(1,2) => 1
SELECT IF(null,2) => 2