Using PostgreSQL, I want to update a column. The information how to update is in another table.
My try was this, but it also updates rows I don't want to update:
update table_1 set column_x = ( select table_2.rename from table_2 where table_2.rename IS NOT NULL and table_1.id = table_2.id)
How to modify the query?
Maybe this helps to explain my problem: http://www.sqlfiddle.com/#!15/318fb/1