View Full Version : Quick MYSQL Pruning Question...
dogbomb
07-04-2004, 10:15 PM
Is there a simple mySQL query I can run on a message board (3.0.1) which will trim all of the messages from a particular forum APART from the first post?
Shame there isn't something in the admin prune options, but has anyone got a mySQL solution?
Andreas
07-04-2004, 10:28 PM
Let's say you want to delete from forum 18:
DELETE FROM post USING post,thread WHERE post.threadid = thread.threadid AND thread.forumid=18 AND post.postid != thread.firstpostid
This should do the trick - it will delete all posts in that forum, except the first post of each thread.
WARNING: Although this query was tested, I don't guarantee anything, so be strongly advised to backup your data first!
Furthermore you must rebuild threads afterwards, as otherwise you will see wrong figures in forumdisplay.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.