Postgresql Update with subquery -


this question has answer here:

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 

sql fiddle example


Comments

Popular posts from this blog

javascript - Unusual behaviour when drawing lots of images onto a large canvas -

how can i manage url using .htaccess in php? -

javascript - Chart.js - setting tooltip z-index -