日期:2014-05-17  浏览次数:20857 次

求一update语句
SQL code
update  salary set ymrtam=a.[补贴]
from dbo.[user] a  join salary  b
on a.an8=b.yman8
where ympdba in(2290)
and ymrtam<>a.[补贴]


这个更新语句是sql server的,如何在oracle下写这个更新语句?谢谢


------解决方案--------------------
update salary b set ymrtam=(select a.[补贴]
from dbo.[user] a where a.an8=b.yman8) 
where b.ympdba in(2290)
and exists(select 1 from dbo.[user] a where a.an8=b.yman8 and b.ymrtam<>a.[补贴]);