mysql 版本
+-----------------------+
| version() |
+-----------------------+
| 6.0.3-alpha-community |
+-----------------------+
系统 windows xp sp3mysql> delimiter ##
mysql> begin
-> declare @a int;
-> set @a=1;
-> select @a;
-> end ##
ERROR 1064 : 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 @a int;set @a=1;select @a;end' at line 3网上找了很多资料都是这么写的,其他人的都可以,都是我的有问题,求解中……
+-----------------------+
| version() |
+-----------------------+
| 6.0.3-alpha-community |
+-----------------------+
系统 windows xp sp3mysql> delimiter ##
mysql> begin
-> declare @a int;
-> set @a=1;
-> select @a;
-> end ##
ERROR 1064 : 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 @a int;set @a=1;select @a;end' at line 3网上找了很多资料都是这么写的,其他人的都可以,都是我的有问题,求解中……
->begin
-> declare @a int;
-> set @a=1;
-> select @a;
-> end ##这个只能写在存储过程里 不能直接写在命令行
create procedure sp_test()
begin
declare @a int;
xxxx
xxx
end