gpt4 book ai didi

MySQL 删除错误 - 无法在 FROM 子句中指定更新目标表

转载 作者:行者123 更新时间:2023-11-29 13:30:37 25 4
gpt4 key购买 nike

伙计们,我正在尝试使用嵌套查询从数据库中删除一些记录:

delete from imageviewer_crreviewerformdata
where imageviewer_crreviewerformdata.FormDataId in
(select distinct imageviewer_crreviewerformdata.FormDataId
from imageviewer_crreviewerformdata,imageviewer_crtask
where imageviewer_crreviewerformdata.TaskId = imageviewer_crtask.TaskId
and imageviewer_crtask.RevProtId in (1));

我得到了众所周知的 mysql 异常。有人可以帮忙制定查询吗?

最佳答案

delete d 
from imageviewer_crreviewerformdata d
inner join imageviewer_crtask t on d.TaskId = t.TaskId
where t.RevProtId in (1)

关于MySQL 删除错误 - 无法在 FROM 子句中指定更新目标表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19515756/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com