我用mysql db为一个应用程序写了这个删除它并不起作用,我已经搜索了答案但是我找不到任何类型的错误,有人可以帮我提一下这个吗? 感谢
1093 - 您无法指定目标表格' md1_acessos'用于FROM子句中的更新
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)
);
答案 0 :(得分:0)
试试这个:
DELETE FROM md1_acessos
WHERE ID_USUARIO = 10
AND NOT
(ID_EMPRESA = 1
AND ID_USUARIO = 1
AND ID_MODULO IN (1,2,6))