This query works but is there any way of making it more elegant or speeding it up?

DELETE from bm_KW USING bm_KW, bmjn_KW WHERE bm_KW.KeywordID 
IN(SELECT bmjn_KW.KeywordID FROM bmjn_KW 
WHERE bmjn_KW.ItemID = '1016' ) AND bm_KW.KeywordID 
NOT IN (SELECT bmjn_KW.KeywordID FROM bmjn_KW 
WHERE bmjn_KW.ItemID != '1016');

Its purpose is to delete only the keywords which are unique to the item being deleted, “1016” in this case.

Posted in: MySQL

Related FAQ's

Marius Ion ANGEL HOT SOFT LLC (800) 316-7677