mysql - mysql存储过程中的return关键字

标签 mysql stored-procedures

<分区>

Possible Duplicate:
Mysql - How to quit/exit from stored procedure

是否有与 php、c++、c、java 等价的东西,无论是 return 语句?

我可以做类似的事吗

IF @numRows >= 1 THEN
  RETURN
END IF;

在mysql存储过程中???

最佳答案

试试这个

Sp:BEGIN
    IF @numRows >= 1 THEN
        LEAVE Sp;
    END IF;

END$$

关于mysql - mysql存储过程中的return关键字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12954423/

相关文章:

php - 合并其他问题的mysql中的两个查询

mysql - 从 SQL 存储过程中的唯一值查找最大数量

mysql - 创建存储过程时出错

php - Mysql while 循环累加数字

python - 类型错误 : unsupported operand type(s) python web2py

Mysql:最近X天没有 Activity 的所有用户

sql - 如何从 SQL 存储过程调用 shell 应用程序?

postgresql - 如何识别 postgresql 中最近更改的 SP?

MySQL - 选择字符串的前 10 个字节

php - 使用 PHP 代码将 mysql 表导出为 CSV