存储过程begin/end

来源:互联网 发布:淘宝怎样才能排名靠前 编辑:程序博客网 时间:2024/05/16 15:18
drop table if exists t;create table t (s1 int);    insert into t values (5);  select * from t;-- --------------------------------------------------drop procedure if exists p7;delimiter //create procedure p7()  begin    set @a = 6;    set @b = 5;  -- 定义两个客户端变量  insert into t values (@a);    select s1 * @a from t where s1 >= @b;  end; // delimiter ;call p7();/*+---------+| s1 * @a |+---------+|      30 ||      36 |+---------+*/

原创粉丝点击