The code below (currently with error) would update all rows in the table, but I'm aiming for that the code should only update the p.hour
of the per_id
in the where clause and not all rows.
It's important that the value for the set is a column form table worker and one from table department
update worker
set p_hour = p_hour + a.hour
where exists
(select
p.per_id,
p.p_hour
from
worker p,
department a
where
p.per_id = a.per_id and
p.per_id = '1234')
This is my current error:
ERROR at line 2: ORA-00904: "a.hour": invalid identifier