PostgreSQL: How to UPDATE multiple attributes with multiple joins

Updated . Posted . Visible to the public.

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
Last edit
Henning Koch
License
Source code in this card is licensed under the MIT License.
Posted by Emanuel to makandra dev (2018-01-03 17:27)