Personally, I prefer the USING clause, but the previous answer is equally valid. Secondly, I propose to study the use of foreign key constraints, this is a much more effective way to do this.
DELETE FROM s, r USING sent_txts s LEFT JOIN received_txts r ON s.msg_link_id = r.id WHERE r.action_id = 6;
Ryan tenney
source share