Is it possible to delete multiple rows in MySQL if the target table is in a partition?
I am using PHPMYAdmin and MySQL database. I would like to remove from table 1masterinventory all rows (PK RID) that are not in 1amazoninventory (PK RID). I feel like this query should work, but I am getting error "# 1093 - You cannot specify the target table '1masterinventory' to update in the FROM clause.
DELETE FROM 1masterinventory
WHERE rid IN
(
SELECT rid
FROM 1masterinventory
WHERE rid NOT IN
(
SELECT rid FROM
1amazoninventory WHERE 1
)
)
+3
source to share