sql - Postgres Update multiple rows -
i need update multiple rows in table.
i have table customer
, contact
i need update customer
linked contact in contact
table has column city
@ value. can rows need query
select cus.id, con.city customer cus, contact con cus.contacts_id=con.id , con.city="myvalue"
i know how update 1 table not understand how update table when rows looked different table.
firstly, please not use old joins (from comma separated tables).
secondly, here go:
update customer set whatever = 'whatever value' contacts_id in ( select id contact city="myvalue" )
Comments
Post a Comment