I have 2 columns named type1 & type2 in a table with the name table1 i need to populate their data to my newly created column models but not just to retrieve their data via query but to actually populate the new column "table1".models
at the moment i can have what i want with the following query
select concat("table1".type1,' ',"table2".type2) as models
from "table1";
I need an update column models command to actually populate the newly created column models in postgres.
Thank you.
first alter table and add new column like this
ALTER TABLE table1 ADD type3 VARCHAR(100) NULL
then update table like this
update table1 set type3 = concat(type1,' ',type2)
update table1 set models = concat(type1,' ',type2)
will do what you try to achieve.