Mysql 条件函数 If Ifnull

IF

IF(condition,true-value,false-value)

IFNULL

IFNULL(cloumn-name, true-value)

与NULL比较

IS NULL IS NOT NUL <=>

1
SELECT name, IF(id IS NULL, Unknown,id) as id FROM taxpayer;