I have these two queries that I would like to combine, but I am to the point, where I'm not sure its possible.
The two queries are:
The first query actually deletes from several tables, but I have paired it down for this post. I only want to delete records from the 'keyword' table if the keyword_id no longer exists in the site_keyword table.
The two queries are:
Code:
//delete from correlation table
DELETE
FROM site_keyword
WHERE keyword_id = 50
//clean up keyword table
DELETE
FROM keyword k LEFT JOIN site_keyword sk
ON k.keyword_id = sk.keyword_id
WHERE sk.keyword_id IS NULL