您的位置:首页 > 数据库 > MySQL

MySQL存储过程实例

2017-04-18 18:10 411 查看
MySQL存储过程实例代码如下:

drop table if exists t1;
create table t1
(
id int not null
);

insert into t1 values(1), (2), (3);

delimiter //

create procedure myfun(in para int)
begin
select * from t1 where id = para;
end;
//

delimiter ;

set @a = 1;
call myfun(@a);
call myfun(2);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: