update column value in postgresql code example

Example 1: update value postgresql

UPDATE table
SET column1 = value1,
    column2 = value2 ,...
WHERE
	condition;

Example 2: update column data type postgres

ALTER TABLE table_name
ALTER COLUMN column_name [SET DATA] TYPE new_data_type;

Example 3: postgres update column with value from another table

UPDATE t1 
set "Column" = t2.column
from t2 
where t2.id = t1."Id";

Example 4: update record in postgreps

UPDATE table_name
SET column1 = value1,
    column2 = value2,
    ...
WHERE condition;

Tags:

Sql Example