delete specific column duplicate data in mysql

I have a mysql table site_visitor with vid(auto_increment),IP,page,visit_time… columns, the problem is many duplicate IP data in the table, only the IP column data is duplicated while the others like isp,visit_time… are not, i did much test and finally find a very simple way.

delete specific column duplicate data in mysql

DELETE duplicate_rows.*
FROM site_visitor AS single_rows
   INNER JOIN site_visitor  AS duplicate_rows ON duplicate_rows.IP= single_rows.IP
      AND duplicate_rows.vid> single_rows.vid;

just run those mysql codes via phpmyadmin or via php query, you will see it’s a magic.

, I'm a freelancer and available now,if need help just contact me without hesitation.


Tags:
Posted by admin in: mysql
  • RSS
  • del.icio.us
  • StumbleUpon
  • Digg
  • TwitThis
  • Mixx
  • Technorati
  • Facebook
  • NewsVine
  • Reddit
  • Google
  • LinkedIn
  • co.mments
  • YahooMyWeb
  • E-mail this story to a friend!

4 Responses to “delete specific column duplicate data in mysql”

  1. forex robot says:

    found your site on del.icio.us today and really liked it.. i bookmarked it and will be back to check it out some more later

  2. Rhett Ohs says:

    hey,this is Rhett Ohs,just discovered your web-site on google and i must say this blog is great.may I quote some of the information found in this web site to my local students?i am not sure and what you think?in any case,Many thanks!

  3. Nice brief and this fill someone in on helped me alot in my college assignement. Thank you seeking your information.

  4. I’ve recently started a blog, the information you provide on this site has helped me tremendously. Thank you for all of your time & work.

Leave a Reply


valid-xhtml10 css2.1 valid © BrightYourSite.com All Right Reaserved