Solved

I need to delete duplicated companies

Posted on 2013-01-14
1
200 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
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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

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

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…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

863 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now