Обновление строки в postgresql

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;
UPDATE table T1 
SET column1 = T2.column1 
FROM 
table T2 
INNER JOIN table T3 USING (column2) 
WHERE T1.column2 = T2.column2;

https://stackoverflow.com/questions/6256610/updating-table-rows-in-postgres-using-subquery

Print Friendly, PDF & Email

Добавить комментарий