UPDATE table
SET column1 = value1,
column2 = value2 ,...
WHERE
condition;
UPDATE table_name
SET column1 = value1,
column2 = value2,
...
WHERE condition;
UPDATE table_name
SET column1 = value1, -- without quotes for numeric values
column2 = 'value2', -- with single quotes for text values
...
WHERE condition;
UPDATE
<table1>
SET
customer=subquery.customer,
address=subquery.address,
partn=subquery.partn
FROM
(
SELECT
address_id, customer, address, partn
FROM /* big hairy SQL */ ...
) AS subquery
WHERE
dummy.address_id=subquery.address_id;
brew services stop postgresql
brew upgrade postgresql
brew postgresql-upgrade-database
brew services start postgresql
UPDATE table_name
SET column1 = value1,
column2 = value2,
...
WHERE condition
RETURNING * | output_expression AS output_name;
Code language: SQL (Structured Query Language) (sql)
UPDATE schema.table_name
SET column1 = 'value1'
, column2 = 'value2'
, ...
WHERE column3 = 'criteria'