DELETE FROM table_a WHERE id IN(
SELECT table_a.id AS id FROM table_a, table_b
WHERE table_a.object_id = 1 AND table_a.code = \'code\'
AND table_a.
There are two (slightly different) syntaxes for deleting from mutliple tables. Here's the one without USING
:
DELETE a
FROM
table_a AS a
INNER JOIN
table_b AS b
ON b.code = a.code
AND b.id = a.b_id
WHERE
a.object_id = 1
AND a.code = 'code'
AND b.`table` = 'testTable' --- Do you actually have a column named "table"?