mysql> DELIMITER // ;
mysql> CREATE PROCEDURE Proc_Uservariables()
-> BEGIN
-> SET @A = 100;
-> SET @B = 500;
-> SELECT @A,@B,@A+@B;
-> END //
Query OK, 0 rows affected (0.00 sec)
mysql> Delimiter ; //
mysql> CALL Proc_Uservariables();
+------+------+-------+
| @A | @B | @A+@B |
+------+------+-------+
| 100 | 500 | 600 |
+------+------+-------+
1 row in set (0.00 sec)
Query OK, 0 rows affected (0.01 sec)
以上就是MySQL存储过程中如何使用用户变量?的详细内容,更多请关注每日运维网(www.mryunwei.com)其它相关文章!