I am trying to delete 96k entries.
delete all entries in the xoops_bb_posts_text tables that do not have the corresponding post_id for xoops_bb_posts
This query worked with 91k records return:
SELECT * FROM xoops_bb_posts_text t WHERE not exists ( select post_id from xoops_bb_posts p WHERE p.post_id = t.post_id );
when I tried to delete these entries, I received a syntax error, but I canβt see it.
DELETE FROM xoops_bb_posts_text t WHERE not exists ( select post_id from xoops_bb_posts p WHERE p.post_id = t.post_id );
Where is the mistake?
Error
SQL Query: Documentation
DELETE FROM xoops_bb_posts_text t WHERE NOT EXISTS ( SELECT post_id FROM xoops_bb_posts p WHERE p.post_id = t.post_id )
MySQL said: Documentation
# 1064 - You have an error in the SQL syntax; check the manual that matches your version of MySQL server for the correct syntax for use next to 'WHERE does not exist (select post_id from xoops_bb_posts p WHERE p.post_id = t.post_' on line 2
source share