I can use
select * from sent_txts s
LEFT JOIN received_txts r ON s.msg_link_id = r.id
WHERE r.action_id = 6;
top select matching rows,
How can I write a query to delete the matching rows on both sides?
Something like
delete sent_txts s
LEFT JOIN received_txts r ON s.msg_link_id = r.id
WHERE r.action_id = 6;
Disclaimer: I do not have access to a mysql database to test at the moment, but I think you can use:
See mysql’s delete documentation for more information. A better method might be to put a foreign key constraint from received_txts to sent, and cascade the delete.