My query is:
DELETE FROM abc_memory INNER JOIN abc USING (abc_id) WHERE x < y
and MySQL complains by saying:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INNER JOIN abc USING (abc_id) WHERE x < y' at line 1
In MySQL there's a limitation on neither joining a memory table with an innodb table nor deleting while joining two normal tables. But is there a limitation on deleting from a memory table while joining that with an InnoDB table?
When you use a
JOINinDELETE, you have to list the table names in theDELETEclause, to tell it which table(s) to delete from.This will just delete from the
abc_memorytable. If you want to delete from both tables, change it toDELETE abc_memory, abc.This is explained in the manual:
You either have to list the tables after
DELETEor in aUSINGclause (this isn't the same as theUSINGoption in theJOINclause).