日期:2014-05-17 浏览次数:21236 次
(case when receive_detail.USER_DEFINED_03 ='NORMAL' then 'Good' when receive_detail.USER_DEFINED_03 ='BAD' then 'Damaged' when receive_detail.USER_DEFINED_03 is null then '/' else receive_detail.USER_DEFINED_03 end) as status
------解决方案--------------------
你是case...when...和case when...没搞清楚
看下书吧,两个用法不一样的
case...when...里的when后面只能接值,不能接表达式!
case when...的when后面只能接表达式不能接值!
------解决方案--------------------
--为何不用decode函数呢? decode(receive_detail.USER_DEFINED_03,'NORMAL','Good', 'BAD','Damaged', '','/', receive_detail.USER_DEFINED_03) as status
------解决方案--------------------
不会吧,我这个试过了,行的啊
with a as(select '1' d from dual union all select '2' from dual union all select '5' from dual union all select '' from dual ) select case when d='1' then '11' when d='2' then '22' when d is null then '/' else d end from a