Project / Support Center
Welcome, Guest. Please login or register. October 19, 2019, 04:12: AM
Home Help Search Login Register
D-Web Web Site Creator D - Web Web Site Creator On-line HTML Editor No Programming knowledge required. Web Global Net PayPal-Cart Shopping Cart System PayPal - Kart Shopping Cart System for E-Commerce over the internet, that's easy to use. Web Global Net Newsletter Manager Newsletter Manager On-line Newsletter Creator with Email Subscriber Management.
Ring Central Discount
Web Global Net Web Application & Web Development Project Center  |  Technical Issues  |  MySQL  |  Topic: statement to delete duplicates entries from a specified column in a MySQL table 0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Go Down Send this topic Print
Author Topic: statement to delete duplicates entries from a specified column in a MySQL table  (Read 802 times)
admin
Administrator
******
Offline Offline

Posts: 162


« on: April 15, 2019, 03:56: PM »

DELETE t1 FROM table_name t1
INNER JOIN
table_name (same as t1) t2
WHERE
t1.column_id < t2.column_id AND t1.column_name = t2.column_name;

leave the t1 & t2 in - what you're doing is creating temp tables and deleting the duplicates from the t2  
« Last Edit: April 17, 2019, 02:31: PM by admin » Report to moderator   Logged

The Unknown Webmaster
Pages: [1] Go Up Send this topic Print 
Web Global Net Web Application & Web Development Project Center  |  Technical Issues  |  MySQL  |  Topic: statement to delete duplicates entries from a specified column in a MySQL table « previous next »
Jump to:  


Login with username, password and session length
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!