xxxxxxxxxx
UPDATE table_name
SET column1 = value1,
column2 = value2,
WHERE condition
RETURNING * | output_expression AS output_name;
Code language: SQL (Structured Query Language) (sql)
xxxxxxxxxx
UPDATE table
SET column1 = value1,
column2 = value2 ,
WHERE
condition;
xxxxxxxxxx
UPDATE dummy
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;
xxxxxxxxxx
UPDATE table_name
SET column1 = value1,
column2 = value2,
WHERE condition;
xxxxxxxxxx
WITH subquery AS (
SELECT
address_id,
customer,
address,
partn
FROM
<table1>;
)
UPDATE <table-X>
SET customer = subquery.customer,
address = subquery.address,
partn = subquery.partn
FROM subquery
WHERE <table-X>.address_id = subquery.address_id;
xxxxxxxxxx
UPDATE table_name
SET column1 = value1, -- without quotes for numeric values
column2 = 'value2', -- with single quotes for text values
WHERE condition;