四.条件推断函数 1.if(expr,v1,v2)函数:成立返回结果v1,否则结果v2 例:select id,if(grade>=60,'pass','fail') from t; 2.IFNULL(V1,V2)函数:假设空显示v2.否则显示v1 例:mysql> select a,ifnull(a,'no') from pet76; +------+----------------+ | a | ifnull(a,'no') | +------+----------------+ | 10…