Solved

I need to delete duplicated companies

Posted on 2013-01-14
1
213 Views
Last Modified: 2013-01-14
Hello,

During many imports my customer imported  the same companies many times.

e.g.

Company 1
Company 2
Company 3
Company 1
Company 2
Company 3
Company 2
Company 3
Company 3

I need to delete them so as only the last should remain from each company instance.
I have a timestamp in the table.

The desired result would be
Company 1
Company 2
Company 3

Thank you in advance
0
Comment
Question by:starhu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 39

Accepted Solution

by:
Pratima Pharande earned 500 total points
ID: 38773753
try this


 

DELETE n1 FROM Company_table n1, Company_table n2 WHERE n1.date_field > n2.date_field AND n1.company_name = n2.company_name

refer
http://stackoverflow.com/questions/4685173/delete-all-duplicate-rows-except-for-one-in-mysql

if any problem share the sample data and column names
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

All XML, All the Time; More Fun MySQL Tidbits – Dynamically Generate XML via Stored Procedure in MySQL Extensible Markup Language (XML) and database systems, a marriage we are seeing more and more of.  So the topics of parsing and manipulating XM…
I have been using r1soft Continuous Data Protection (http://www.r1soft.com/linux-cdp/) for many years now with the mySQL Addon and wanted to share a trick I have used several times. For those of us that don't have the luxury of using all transact…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question