(SQL) How can I remove duplicate content from DB?

Status
Not open for further replies.

hatem20

Active Member
1,458
2009
79
5
Hey,

I got over 2k duplicate content in my site SQL database, I need a quick solution to remove them and just keep the older/original post.

I used this command to sort the duplicate content according to titles:
Code:
SELECT title, COUNT(*) FROM dle_post Group BY `title` HAVING COUNT(*) > 1
here's the result:
[SLIDE]http://i27.lulzimg.com/c173a98425.jpg[/SLIDE]

As you can see, below each title there are 2-4 "copies" - I want to keep one and remove the rest. Is that possible? :D

I look forward to reading your thoughts.
Thanks in advance.
 
1 comment
Status
Not open for further replies.
Back
Top