IZ
Неожиданное ключевое слово. (near "WHERE" at position 26)
Неизвестный оператор. (near "WHERE" at position 26)
Но синтаксически можно
Size: a a a
IZ
IZ
IZ
mysql> DELETE FROM attribute WHERE id IN (SELECT id FROM attribute as attr WHERE NOT EXISTS (
SELECT null FROM attribute as attr2 WHERE attr.parent_attribute_id = attr2.id ) AND attr.parent_attribute_id IS NOT NULL);
ERROR 1093 (HY000): You can't specify target table 'attribute' for update in FROM clause
MC
MC
MC
AP
MC
DELETE FROM attribute attr
WHERE NOT EXISTS
(SELECT NULL
FROM attribute attr2
WHERE attr.parent_attribute_id = attr2.id )
AND attr.parent_attribute_id IS NOT NULL
MC
MC
MC
DELETE
FROM attribute
WHERE id IN
(SELECT *
FROM
(SELECT id
FROM attribute AS attr
WHERE NOT EXISTS
(SELECT NULL
FROM attribute AS attr2
WHERE attr.parent_attribute_id = attr2.id )
AND attr.parent_attribute_id IS NOT NULL) AS t1);
MC
IZ
DELETE FROM attribute attr
WHERE NOT EXISTS
(SELECT NULL
FROM attribute attr2
WHERE attr.parent_attribute_id = attr2.id )
AND attr.parent_attribute_id IS NOT NULL
MC
MC
MC
IZ
MC
MC
Query OK, 8210047 rows affected (37 min 51.02 sec)