Halfagain IM Forums
May 24, 2012, 19:54 *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Due to increasing spam we are forced to make this forum "Read Only". If you have an issue, most likely was discussed here. Use the Search function and try to find related discussions. If you can't find any helpful information, just email support at halfagain dot com"
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: SQL help  (Read 888 times)
0 Members and 1 Guest are viewing this topic.
tizer
Newbie
*

Karma: 10
Offline Offline

Posts: 14


« on: January 07, 2008, 23:59 »

OK - I'm a dumbass - I set up a blog a few months ago with an auto poster and a rssMagician feed... only thing is I choose to rewrite the title - which as it turns out is what the auto poster uses to check for duplicates Smiley

So I have around 8000 posts on this blog, but only around 300 are unique.

I've got this SQL code to show me the unique records
SELECT DISTINCT post_content
FROM wp_posts
LIMIT 300;

But how do I get these unique records to replace the 8000 duplicate posts already have?
Logged
Omar
Here to help.
Administrator
Hero Member
*****

Karma: 10001
Offline Offline

Posts: 2687


« Reply #1 on: January 08, 2008, 08:16 »

Well.. only that code does not help anyone too much. I think you should ask the maker of the autoposter that you use, they know better how their program work (and why even posted duplicates if it shouldn't)
Logged
tizer
Newbie
*

Karma: 10
Offline Offline

Posts: 14


« Reply #2 on: January 10, 2008, 06:56 »

OK - I fixed by making the post_content unique:
Quote
ALTER IGNORE TABLE wp_posts ADD UNIQUE INDEX indexname (post_content(50));


The reason it posted duplicates was because it checked the title for duplicates - so - which I was rewriting with rssMagician - not a problem, I just wanted to clean up an old blog Smiley
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.8 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!