I want to make an update on a table with the results of a query and that records exist in the tables, my SLQ is:
UPDATE reparticion SET responsable_nombre_completo = (select CONCAT_WS(',',persona.nombre,persona.apellido) FROM persona INNER JOIN usuario on usuario.cuil = persona.cuil) WHERE reparticion.id IN (select persona.reparticion_id FROM persona INNER JOIN usuario on usuario.cuil = persona.cuil INNER JOIN reparticion on reparticion.id = persona.reparticion_id);
but I get the following error:
You can't specify target table 'reparticion' for update in FROM clause