Created
September 8, 2010 02:19
-
-
Save sproutventure/569497 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Delete duplicate comments | |
// Creates a temp table of IDs to compare later | |
CREATE TEMPORARY TABLE unique_comments SELECT MAX(c1.comment_ID) as ID FROM wp_comments c1 GROUP BY c1.comment_content ORDER BY ID; | |
// If the comment ID isn't in the unique table delete it | |
DELETE FROM wp_comments WHERE comment_ID NOT IN (SELECT ID FROM unique_comments); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yeah ... those comments are not SQL friendly at all.