11问答网
所有问题
oracle 的存储过程if怎么嵌套啊?
想实现switch 类似的功能
举报该问题
推荐答案 2009-12-21
我给你举个例子:
--配送量(万箱)
select sum(QUANTITY_SUM) into quantity_sum from DWV_OUT_DIST_BILL where to_char(DIST_DATE,'YYYYMM')=month ;
if quantity_sum is null then
quantity_sum:=0;
end if;
--转换成万箱
quantity_sum :=quantity_sum/50/10000;
温馨提示:答案为网友推荐,仅供参考
当前网址:
http://11.wendadaohang.com/zd/F8qPPS24S.html
其他回答
第1个回答 2009-12-27
case when a=‘a’ then a=‘a’;
when b='b' then b='b';
... ...
when others then xxx;
end case;
以上就是oracle的开关语句。不过你的oracle版本貌似得是9i以上的哦
第2个回答 2009-12-21
可以用CASE来实现类似的SWITCH
例:
update lyn.e set name= case
when id=124 then 'LYN'
when id=154 then 'CAY'
when id=554 then 'DAY'
else name
end
相似回答
求教一下
oracle存储过程中if的嵌套
使用问题
答:
一、
if
()then if()then end if;end if;二、if()then elsif()then end if;
大家正在搜
oracle 存储过程 if
oracle存储过程for 循环
oracle存储过程if判断
oracle存储过程into
oracle存储过程与函数的区别
oracle中存储过程的关键字
oracle存储过程在哪
oracle退出存储过程
oracle存储过程详解
相关问题
oracle存储过程中嵌套多个if
求教一下oracle存储过程中if的嵌套使用问题
oracle 存储过程里的if else
Oracle数据库存储过程中怎么样用if嵌套啊?如果<M<3...
oracle中else语句还能在嵌套if语句吗
oracle存储过程技术怎么就那么不规范?if else i...
oracle 存储过程中if else的应用