The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
SQL to Delete Duplicate posts in VB 3.8
Hi Guys
I've been trying to use the following SQL command to delete duplicate posts in a single thread: Code:
SELECT bad_rows. * FROM post AS bad_rows INNER JOIN ( SELECT threadid, dateline, username, userid, MIN( postid ) AS min_postid FROM post GROUP BY threadid, dateline, userid HAVING count( * ) >1 ) AS good_rows ON good_rows.threadid = bad_rows.threadid AND good_rows.dateline = bad_rows.dateline AND good_rows.userid = bad_rows.userid AND good_rows.min_postid <> bad_rows.postid http://www.vbulletin.com/forum/showthread.php?t=285501 Unfortuantly, when I run this query on version 3.8 of my boards I get the following error message: Quote:
Many many thanks in advance Regards Mark |
#2
|
|||
|
|||
Sorry to bump guys but my forums are looking really messy after a failed import.
Any ideas or suggestions greatly appreciated. Cheers Mark |
#3
|
|||
|
|||
just a suggestion: re-type the query making sure you have no spurious characters in the text and no extra whitespace at the end of the lines (which sometimes happens when you cut & paste) because when i run the query from your post against my dbms from the sql commandline, I don't get any sql errors:
[SQL] SELECT bad_rows. * FROM post AS bad_rows INNER JOIN ( SELECT threadid, dateline, username, userid, MIN( postid ) AS min_postid FROM post GROUP BY threadid, dateline, userid HAVING count( * ) >1 ) AS good_rows ON good_rows.threadid = bad_rows.threadid AND good_rows.dateline = bad_rows.dateline AND good_rows.userid = bad_rows.userid AND good_rows.min_postid <> bad_rows.postid Affected rows: 0 Time: 0.098ms not saying the sql is correct for the task you want to accomplish, just that it's not throwing errors for me. |
#4
|
|||
|
|||
Where would I add this SQL?
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|