Register Members List Search Today's Posts Mark Forums Read

Thread Tools
Old 23 Oct 2009, 10:17
newmomsforum newmomsforum is offline
Join Date: Mar 2006
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:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

The SQL query was originally posted by Wayne here although this was for an earlier version of VB:

Unfortuantly, when I run this query on version 3.8 of my boards I get the following error message:

An error occurred while attempting to execute your query. The following information was returned.
error number: 1064
error desc: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT threadid, dateline, username, userid, MIN( postid ) AS m
Does anyone have any ideas what will work on my boards

Many many thanks in advance


Reply With Quote
Old 25 Oct 2009, 02:32
newmomsforum newmomsforum is offline
Join Date: Mar 2006
Sorry to bump guys but my forums are looking really messy after a failed import.

Any ideas or suggestions greatly appreciated.


Reply With Quote
Old 31 Oct 2009, 20:01
gmerin gmerin is offline
Join Date: Dec 2008
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
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.
Reply With Quote
Old 17 Nov 2010, 20:38
FlyingBurrito4 FlyingBurrito4 is offline
Join Date: Aug 2010
Where would I add this SQL?
Reply With Quote

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

New To Site? Need Help?

All times are GMT. The time now is 03:41.

Layout Options | Width: Wide Color: