您好,欢迎访问一九零五行业门户网

Mysql中存储过程if else的问题简析_MySQL

bitscn.com
以下这样写会报错:
[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 'end if' at line 8     create procedure test(in a int) if a > 1 then   select 1; elseif a>2 then   select 2; else  end if; [xhtml]create procedure test(in a int)  if a > 1 then    select 1;  elseif a>2 then    select 2;  else       end if;  应改成以下这样: create procedure test(in a int) if a > 1 then   select 1; elseif a>2 then   select 2; else -- do nothing -- set @tmp=1; end if;    作者 zhu473105308 bitscn.com
其它类似信息

推荐信息