DELETE FROM table1 WHERE topic_id=9 ;
DELETE T1 FROM table1 T1 LEFT JOIN table2 T2 ON T1.topic_id=T2.topic_id WHERE T1.topic_id=9 AND T2.status=-1 ;