Those with a SqlServer background will be familiar with the UPDATE .. FROM syntax.
For example (totally made up)
update employee_bonus
set bonus = 0
from employee_bonus b
inner join employees e on b.employee_id = e.employee_id
where e.bonus_eligible = 'N'
Those who transitioned from SqlServer to Oracle might find the absence of the UPDATE FROM a significant loss. The best Oracle alternative that I know of is as follows.
update ( select bonus
from employee_bonus b
inner join employees e on b.employee_id = e.employee_id
where e.bonus_eligible = 'N' ) t
set t.bonus = 0
Actually, if you look at it, they are very similar.
评论