PostgreSQL: How to UPDATE multiple attributes with multiple joins

This is an extension to PostgreSQL vs MySQL: How to UPDATE using a JOIN.

UPDATE employees
SET department_name = departments.name,
  department_area = areas.name
FROM departments, areas
WHERE employees.department_id = departments.id
AND departments.id = areas.department_id
Emanuel Over 6 years ago