码迷,mamicode.com
首页 > 数据库 > 详细

mysql中if语句

时间:2015-08-18 11:30:36      阅读:124      评论:0      收藏:0      [点我收藏+]

标签:

#1、IF表达式
IF(condition,expr1,expr2)
//如果condition成立返回expr1,否则返回expr2

#2、IFNULL表达式
IFNULL(expr1,expr2)
//如果expr1不为空返回expr1,为空返回expr2

#3、IF/ELSE表达式
IF condition1 THEN 
    XXX
ELSEIF condition2 THEN 
    XXX
ELSE 
    XXX
END IF

 

mysql中if语句

标签:

原文地址:http://www.cnblogs.com/boystar/p/4738558.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!