Debido a los problemas de implementación de bloqueo, MySQL
no permite referenciar la tabla afectada con DELETE
o UPDATE
.
Necesitas hacer un JOIN
aquí en cambio:
DELETE gc.*
FROM guide_category AS gc
LEFT JOIN
guide AS g
ON g.id_guide = gc.id_guide
WHERE g.title IS NULL
o simplemente use un NOT IN
:
DELETE
FROM guide_category AS gc
WHERE id_guide NOT IN
(
SELECT id_guide
FROM guide
)