mysql 存储过程 输入输出


delimiter ||
CREATE procedure next
(in in_id            INT,
 in in_table_code      VARCHAR(255),
 in in_site_code     VARCHAR(20),
 in in_goods_code    VARCHAR(40),
 out out_min_id     INT,
 out out_price DOUBLE,
 out out_comment_total INT
)
begin
select  min(id) from price_history
where id>in_id and table_code=in_table_code and site_code=in_site_code
    and goods_code=in_goods_code into out_min_id;
select comment_total from price_history where id=out_min_id into out_comment_total;
end||
delimiter ;
call next(1,'01','360BUY','595936',@out_min_id,@p,@c);
select @out_min_id,@p,@c;


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM