delimiter @@;
declare @i int;
@@You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'declare @i int;
@@' at line 1这为什么都错啊,变量不是这么申明的?
declare @i int;
@@You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'declare @i int;
@@' at line 1这为什么都错啊,变量不是这么申明的?
也可不必定义
mysql> set @a=1;
Query OK, 0 rows affected (0.00 sec)mysql> select @a;
+------+
| @a |
+------+
| 1 |
+------+
1 row in set (0.00 sec)mysql>
declare i int;
declare必须在sp中声明使用