I wrote this delete for an application with mysql db and it doesn't work, I already search for answers but I cant find any kind error, someone can help me with a tip about this? thanks
1093 - You can't specify target table 'md1_acessos' for update in FROM clause
DELETE FROM md1_acessos
WHERE ID_USUARIO = 10
AND ID_UNIDADE not in (
SELECT ID_UNIDADE
FROM md1_acessos
WHERE ID_EMPRESA = 1
AND ID_USUARIO = 1
AND ID_MODULO IN (1,2,6)
);