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.
This is a common MySQL issue, use a temporary table between the select and update/delete:
DELETE FROM table_a WHERE id IN
(select id from
(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.code = table_b.code
AND table_b.id = table_a.b_id
AND table_b.table = 'testTable')
) tempTable