请教各位大虾: oracle中多表关联时update有case语句如何处理?
例:
update a
set a.a01=
case
when a.a23<1000 then 1000*b.b07*1.5
else a.a23*b.b07*1.5
from b where a.a09=b.b02以上语句在SQL中是没有问题的,但在oracle中要如何转换呢?
谢谢了!
例:
update a
set a.a01=
case
when a.a23<1000 then 1000*b.b07*1.5
else a.a23*b.b07*1.5
from b where a.a09=b.b02以上语句在SQL中是没有问题的,但在oracle中要如何转换呢?
谢谢了!
set a.a01=select
case
when a.a23<1000 then 1000*b.b07*1.5
else a.a23*b.b07*1.5 end
from b where a.a09=b.b02
up不过还要注意一点,需要括号update a
set a.a01=
(select
case
when a.a23<1000 then 1000*b.b07*1.5
else a.a23*b.b07*1.5 end
from b where a.a09=b.b02
)