El clasico insert donde no esta update donde si usando left joins :)
Código SQL:
Ver originalINSERT INTO tabla_destino
SELECT * FROM tabla_origen AS t1
LEFT JOIN tabla_destino AS t2 ON (t1.id=t2.id)
WHERE t2.id IS NULL
UPDATE tabla_destino
SET valor=completa.valor
FROM
(
SELECT * FROM tabla_origen AS t1
LEFT JOIN tabla destino AS t2 ON (t1.id=t2.id)
WHERE t2.id IS NOT NULL
) AS completa WHERE completa.id=tabla_destino.id
Que eso es lo miso que hace un merge......