我需要从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”进行更新