I want the table name which contain record when using union in mysql. I want to delete the records from that table or else i have to go through all tables and find the records and delete manually.
The query:
SELECT id FROM table1 WHERE cfid='2'
UNION
SELECT id FROM table2 WHERE ob_id='2'
UNION
SELECT id FROM table3 WHERE jid='2'