'Remove records what is not contain in second table
I have to 2 tables:
lang_temp (newest data):
sku|postid|fi|en|ru (15000 records )
full_products:
sku|postid|fi|en|ru|xx|zzz|aaaa|bbb (15200 records)
postid are unique and it cant be same.
I need to delete full_products records by postid that does not exist in lang_temp table/
Solution 1:[1]
DELETE FROM
full_products
WHERE
NOT EXISTS (SELECT * FROM lang_temp l WHERE full_products.postid = l.postid)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 |