【发布时间】:2018-07-12 11:13:45
【问题描述】:
如何退出外层IF语句,继续存储过程
IF (true) THEN
-- do some work here
IF (somethingWrong=true) THEN
-- Exit from the outer IF and continue SP
END IF;
-- do some work here
END IF;
【问题讨论】:
-
您现在拥有代码的方式,无论内部条件是否为真,执行都会以任何方式退出外部
IF块。您到底在寻找什么? -
IF (somethingWrong==true) THEN==在 MySQL 中不存在 (sqlfiddle.com/#!9/340e01/441) 你需要使用=来检查等于
标签: mysql if-statement stored-procedures