Update whole column in postgres sql

I need to update whole column selecting from another column

I tried this

update  turnoverrate_tm.dm_turnover_tmp_sales
set t.dmitm=w.dmitm
from turnoverrate_tm.w2nx3l04i as w
inner join turnoverrate_tm.dm_turnover_tmp_sales as t
on w.dmitm=t.sditm;`

`
and got this error
ERROR: column "t" of relation "dm_turnover_tmp_sales" does not exist
LINE 2: set t.dmitm=w.dmitm

Help me in updating this column

>Solution :

This is how you update from another column

update  turnoverrate_tm.dm_turnover_tmp_sales as t
set dmitm= w.dmitm
from turnoverrate_tm.w2nx3l04i as w
where t.sditm=w.dmitm

Leave a Reply