0
I’m trying to apply a DELETE
in more than one table, tables have a column (not of the same name) with the same attributes. I want to delete through ID. But I have the table usuario
with column id and areausuario
column-shaped idUsuario
, are the same attributes (id = 1
, IdUsuario = 1
).
I was trying with this code.
DELETE us.*
FROM usuarios us
INNER JOIN disponibilidade ds ON (us.id = ds.IdUsuarios)
INNER JOIN areausuarios au ON (ds.IdUsuarios = au.IdUsuarios)
INNER JOIN gestor g ON (au.IdUsuarios = g.id)
WHERE g.id = 7;
But this code is only deleting from one table.
I tried some others but he applies the error 1451, where I can’t delete the usuario
, without first removing it from the table areausuarios
.