ifnull(col1,col2)函数:如果col1字段为null,则返回col2。 SELECT IFNULL(`name`,CONCAT(firstname,lastname)) FROM USER;