我必须删除guide_category
与guide
表无关的行(死关系)。
这是我想做的,但它当然不起作用。
DELETE FROM guide_category AS pgc
WHERE pgc.id_guide_category IN (SELECT id_guide_category
FROM guide_category AS gc
LEFT JOIN guide AS g ON g.id_guide = gc.id_guide
WHERE g.title IS NULL)
错误:
您不能在 FROM 子句中指定目标表 'guide_category' 进行更新