over 4 years ago
Hello readers!. If you having the much of redundant/duplicate data growing in your database you can delete it with just a single query as I wrote here.
Let say I have a table Address and want to delete the all the duplicate records whose city column is same
or we can delete any records sharing same column type.
DELETE e1 FROM Address e1, Address e2 WHERE e1.id > e2.id AND e1.city = e2.city
After this query all your duplicate records which comes later will be deleted. And if you want to keep the latest one records you just need to reverse the '>' with '<' and new query will go like this
DELETE e1 FROM Address e1, Address d2 WHERE e1.id < e.id AND e1.city = e2.city
Starting with Chrome version 45, NPAPI is no longer supported for Google Chrome. For more information, see Chrome and NPAPI (blog.chromium.org).
Firefox and Microsoft Internet Explorer are recommended browsers for websites using java applets.
Chrome Version Support
Are you sure, you want to delete this comment?
© copyright 2017 FindNerd.com. All rights reserved.
Sign up using