13.6.5.7 RETURN Statement语句

RETURN expr

The RETURN statement terminates execution of a stored function and returns the value expr to the function caller. RETURN语句终止存储函数的执行,并将值expr返回给函数调用方。There must be at least one RETURN statement in a stored function. 存储函数中必须至少有一个RETURN语句。There may be more than one if the function has multiple exit points.如果函数有多个退出点,则可能有多个退出点。

This statement is not used in stored procedures, triggers, or events. 此语句不用于存储过程、触发器或事件。The LEAVE statement can be used to exit a stored program of those types.LEAVE语句可用于退出这些类型的存储程序。