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