Posted over 1 year ago. Visible to the public.

PostgreSQL: How to UPDATE multiple attributes with multiple joins

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

Copy
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

Once an application no longer requires constant development, it needs periodic maintenance for stable and secure operation. makandra offers monthly maintenance contracts that let you focus on your business while we make sure the lights stay on.

Owner of this card:

Avatar
Emanuel De
Last edit:
over 1 year ago
by Henning Koch
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Emanuel De to makandra dev
This website uses cookies to improve usability and analyze traffic.
Accept or learn more