sql >> Base de Datos >  >> RDS >> Mysql

Actualización H2 con unión

Prueba algo como esto:

update table_a a
set a.b_id = (select b.id from table_b b where b.a_id = a.id)
where exists
(select * from table_b b where b.a_id = a.id)