Skip to content
Advertisement

How to update multiple columns on PostgreSQL with values from another table

I have the following update statement:

but.. what if I have more values that need to be updated? Do I need to:

This looks expensive. Couldn’t find any other way though.

Advertisement

Answer

One way is to update both columns in a single expression:

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement