mysql智能存储过程
来源:互联网 发布:besiege mac版 编辑:程序博客网 时间:2024/04/29 20:41
创建存储过程:
create procedure ordertotal(
in onumber int,
in taxable boolean,
out ototal decimal(8,2)
) COMMENT 'Obtain order total,optionally adding tax'
begin
DECLARE total decimal(8,2);
declare taxrate int DEFAULT 6;
select sum(item_price * quantity) from orderitems where order_num = onumber into total;
if taxable then
select total+(total/100*taxrate) into total;
end if;
select total into ototal;
end;
调用存储过程:taxable为真
call ordertotal(20005,1,@total);
select @total;
调用存储过程:taxable为假
call ordertotal(20005,1,@total);
select @total;
- mysql智能存储过程
- 【mysql】mysql存储过程
- MySQL存储过程详解 mysql 存储过程
- MySQL存储过程详解 mysql 存储过程
- MySQL存储过程详解 mysql 存储过程
- MySQL存储过程详解 mysql 存储过程
- MySQL存储过程详解 mysql 存储过程
- MySQL存储过程详解 mysql 存储过程
- MySQL存储过程详解 mysql 存储过程
- MySQL存储过程详解 mysql 存储过程
- MySQL存储过程详解 mysql 存储过程
- MySQL存储过程详解 mysql 存储过程
- MySQL存储过程详解 mysql 存储过程
- MySQL存储过程详解 mysql 存储过程
- MySQL存储过程详解 mysql 存储过程
- MySQL存储过程详解 mysql 存储过程
- MySQL存储过程详解 mysql 存储过程
- MySQL存储过程详解 mysql 存储过程
- 常见的可用的爬虫项目
- 黑马程序员---在HTML文档中引用CSS有几种方式?请指出它们分别是什么?
- PHP程序报错:Warning: Cannot modify header information - headers already sent的问题解决方法
- Linux系统的启动过程
- XML---Android中解析XML .
- mysql智能存储过程
- 单例模式的实现
- HTML超出文本多行截取代码
- OceanBase里面的rowkey是什么概念,是由哪些要素构成的?
- 软件设计参考
- hdu 1392凸包周长
- OneDayOneEx: 3 音乐播放器
- hud1071 The area
- HDU 2517 棋盘分割