Home > database >  Update whole column in postgres sql
Update whole column in postgres sql

Time:11-22

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

CodePudding user response:

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
  • Related