IF(expr1,expr2,expr3)
如果 expr1 是TRUE (expr1 <> 0 and expr1 <> NULL), 則 IF() 的返回值爲 expr2;否則返回值則爲 expr3
select if(size=1,"大","小") as size from apple where id = '111'
IFNULL(expr1,expr2)
假如 expr1 不爲 NULL,則 IFNULL() 的返回值爲 expr1 ;否則其返回值爲 expr2
select IFNULL(1,0); -> 1
select IFNULL(NULL,10); -> 10
select IFNULL(1/0,10); -> 10
select IFNULL(1/0,'yes'); -> 'yes'