Postgresql Update with subquery -
this question has answer here:
- how update + join in postgresql? 6 answers
update customer c set name = b.name, age = b.age (select a.*, b.* customer_temp a.id = b.id) b
i got sql above, after run query, update rows same result.
i wonder need after
update customer c set name = b.name, age = b.age (select a.*, b.* customer_temp a.id = b.id) d c.id = d.id
but got id ambiguous last query.
try this
update customer set name = b.name, age = b.age customer c inner join customer_temp b on b.id = c.id
Comments
Post a Comment