
|  500 |
+------+

The following statement joins two tables: one is only used to satisfy a WHERE
condition, but no row is deleted from it; rows from the other table are
deleted, instead.

DELETE post FROM blog INNER JOIN post WHERE blog.id = post.blog_id;

Deleting from the Same Source and Target
----------------------------------------

CREATE TABLE t1 (c1 INT, c2 INT);
DELETE FROM t1 WHERE c1 IN (SELECT b.c1 FROM t1 b WHERE b.c2=0);

Until MariaDB 10.3.1, this returned:

ERROR 1093 (HY000): Table 't1' is specified twice, both as a target for
'DELETE' 
 and as a separate source for

From MariaDB 10.3.1:

Query OK, 0 rows affected (0.00 sec)

URL: https://mariadb.com/kb/en/delete/