SQL – how to remove lots of data from one table using a reference for another.
-
I’m using WP for a car site.
I have the cc_posts table and another table cc_posts_detail that I use for, well, car details.
Currently there are over 45k cars on the system which come in from three sources. I’m trying to write a query that will delete all post entries and post_detail entries as follows but I think there’s something wrong with it as it always seems to lock up the db.
delete from cc_posts where id in (SELECT post_id FROM <code>cc_posts_detail</code> WHERE referrer_site = "vendor1")
Is there anything wrong with the query?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘SQL – how to remove lots of data from one table using a reference for another.’ is closed to new replies.