56,679
社区成员
发帖
与我相关
我的任务
分享
mysql> create table t (s1 int);
Query OK, 0 rows affected (0.13 sec)
mysql> delimiter //
mysql> CREATE PROCEDURE P8()
-> BEGIN
-> DECLARE a INT;
-> DECLARE b INT;
-> SET a = 5;
-> SET b = 5;
-> INSERT INTO t VALUES (a);
-> SELECT s1 * a FROM t WHERE s1>=b;
-> END//
Query OK, 0 rows affected (0.31 sec)
mysql> delimiter ;
mysql> call P8();
+--------+
| s1 * a |
+--------+
| 25 |
+--------+
1 row in set (0.09 sec)
Query OK, 0 rows affected (0.09 sec)
mysql>