Oracle多表更新脚本



我正在使用这个脚本

update arinvt 
set cycle_cound_code = 'A'
where std_cost > 200, 

set cycle_count_code = 'B'
where std_cost > 100, 
set cycle_count_code 'C' 
where std_cost > 50, 
else 'D'

所以它似乎为Sap水晶报告工作,但它不会在我的oracle数据库工作。我得到这个错误消息:ORA-00933 SQL命令没有正确结束。我不知道我哪里做错了。如果我只运行第一行:

update arinvt 
set cycle_cound_code = 'A'
where std_cost > 200

这似乎工作,直到我添加它的其余部分。

使用case表达式代替:

update arinvt 
set cycle_cound_code =
case when std_cost > 200 then 'A' 
when std_cost > 100 then 'B'
when std_cost > 50  then 'C'
else 'D'
end

最新更新