Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql 程序中的if语句有什么问题?_Mysql_Mariadb_Procedure - Fatal编程技术网

Mysql 程序中的if语句有什么问题?

Mysql 程序中的if语句有什么问题?,mysql,mariadb,procedure,Mysql,Mariadb,Procedure,编写sql过程很简单 demiliter // create procedure show_growth() begin SELECT * from tb; end // 我想在过程中添加if语句。 先放下它 drop procedure show_growth // 然后创建一个新的 create procedure show_growth(in type char(3)) -> begin -> if type = "all" then ->

编写sql过程很简单

demiliter //
create procedure show_growth()
begin
SELECT * from tb;
end //
我想在过程中添加if语句。
先放下它

 drop procedure show_growth //
然后创建一个新的

create procedure show_growth(in type char(3))
    -> begin
    -> if type = "all" then 
    -> SELECT * from tb;
    -> endif
    -> end //
错误1064(42000):您的SQL语法有错误;检查与您的MariaDB服务器版本对应的手册,以了解第6行“end”附近要使用的正确语法


如何修复它?

endif
不是一个单词

 begin
   if type = "all" then    
    SELECT * from tb;
   end if;
 end

我不熟悉mariadb,但我认为这是一个缺失的