MySQL functions, IF, CASE

MySQLTutorial官网

IF function

syntax:

IF(expr,if_true_expr,if_false_expr)

CASE expression

syntax:

 CASE value
WHEN compare_value_1 THEN result_1
WHEN compare_value_2 THEN result_2

ELSE result END

second form:

 CASE
WHEN condition_1 THEN result_1
WHEN condition_2 THEN result_2

ELSE result END

CASE statement  (for Stored Procedure)

syntax:

 CASE  case_expression
WHEN when_expression_1 THEN commands
WHEN when_expression_2 THEN commands
...
ELSE commands
END CASE;
上一篇:win32用GDI+加载png图片作为背景图


下一篇:canvas 基础知识