美文网首页
mysql——if

mysql——if

作者: 含泪若笑 | 来源:发表于2020-04-16 17:47 被阅读0次

IF(expr1,expr2,expr3),如果expr1的值为true,则返回expr2的值,如果expr1的值为false,则返回expr3的值。

select name, if(sex=0,'女','男') as sex from student;

相关文章

网友评论

      本文标题:mysql——if

      本文链接:https://www.haomeiwen.com/subject/crsdvhtx.html