Skip to content
Advertisement

update rows using inner join posgresql

I have 2 tables users and countries, and i’m trying to set the country.name with users.country_name for all countries with null name.

Schema :

enter image description here

Ref: U.country_code > countries.code

QUERY

Error : DBSQLException: SQL Error [42P01]

Advertisement

Answer

Follow the correct update join syntax and also remove the alias from the LHS of the SET clause:

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