【发布时间】:2020-10-29 14:57:45
【问题描述】:
我想删除 kontext(column_name) 值,这些值与 fmea 值不同于 null 的 substrinct 不同。我可以通过这个查询选择这些值:
select *
FROM fmea001
where substring_index(kontext, ".", 1)
not in (Select substring_index(kontext, ".", 1)
from fmea001
where fmea is not null
and lkey = 9)
但是当我尝试删除时
delete *
FROM fmea001
where substring_index(context, ".", 1)
not in (Select substring_index(context, ".", 1)
from fmea001
where fmea is not null
and lkey = 9))
我收到此错误
错误代码:1093。您不能在 FROM 子句中指定目标表 'fmea001' 进行更新
您知道执行删除语句的另一种方法吗?谢谢!
【问题讨论】:
标签: mysql sql subquery left-join sql-delete