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

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

mapreduce - Resource manager does not transit to active state from standby -

serialization - Convert Any type in scala to Array[Byte] and back -