MySQL> SELECT CASE 1 WHEN 1 THEN one
-> WHEN 2 THEN two ELSE more END;
-> one
mysql...> SELECT CASE WHEN 1>0 THEN true ELSE false END;
-> true
mysql> SELECT CASE BINARY B...mysql> SELECT IF(1>2,2,3);
-> 3
mysql> SELECT IF(1<2,yes ,no);
-> yes
-- strcmp 比较两字符串...mysql> SELECT IF(STRCMP(test,test1),no,yes);
-> no
如果expr2 或expr3中只有一个明确是 NULL,则IF() 函数的结果类型...mysql> SELECT IF(null,1,0);
-> 0
mysql> SELECT IF(0.10,1,0);
-> 1