一、参数 :IN `in_name` INT,out bid int,out bname varchar(255),out bage int //ps:varchar类型的要定义长度
二、代码://因为不能循环输出,所以mysql需要返回的参数都必须有个out类型的接收
BEGIN
DECLARE b INT;
DECLARE o INT;
SET b=in_name;
IF b>10 THEN
insert into product(name,age) values("大于10",b);
ELSE
INSERT into product(name,age) values("小于10",b);
END IF;
//注意之前犯的错误,end if结尾需要分号
select max(id) into o from product where age=b;
……
//select id into bid from product where id=o;
//select name into bname from product where id=o;
//select age into bage from product where id=o;
END