Когда я пытаюсь
DELETE FROM `TreePaths` WHERE `descendant` IN (SELECT `descendant` FROM `TreePaths` WHERE `ancestor`= 0x04);
, я получаю
# 1093 - Вы не можете указать целевую таблицу TreePaths для обновления в предложении FROM
Как получить удаление на работу?
обновление: Структура таблицы:
CREATE TABLE TreePaths (
ancestor VARBINARY(16) NOT NULL,
descendant VARBINARY(16) NOT NULL,
PRIMARY KEY (`ancestor`, `descendant`),
FOREIGN KEY (`ancestor`) REFERENCES Library(iD),
FOREIGN KEY (`descendant`) REFERENCES Library(iD)
);
Данные таблицы:
ancestor descendant
01 01
02 02
02 03
03 03
02 04
04 04
02 05
04 05
05 05
02 06
04 06
06 06
07 07
08 08
09 09
10 10