IF函数根据条件的结果为true或false,返回第一个值,或第二个值
IF(condition, value_if_true, value_if_false)
select name,if(sex=0,'女','男') as sex from userinfo