UPDATE emply
SET e_age = e_age + 10
FROM emply
JOIN department ON emply.e_dept = department.d_dpt;
您似乎在使用SQL Server更新联接语法,这在Oracle上不起作用。一个可行的解决方案可能使用相关的子查询:
UPDATE emply e
SET e_age = e_age + 10
WHERE EXISTS (SELECT 1 FROM department d WHERE d.d_dpt = e.e_dept);