

MySQL provides you with the DELETE JOIN statement that allows you to remove duplicate rows quickly. A) Delete duplicate rows using DELETE JOIN statement The following query returns the duplicate emails in the contacts table: SELECTĬode language: SQL (Structured Query Language) ( sql )Īs you can see, we have four rows with duplicate emails. ORDER BY email Code language: SQL (Structured Query Language) ( sql ) This query returns data from the contacts table: SELECT * FROM contacts Note that you can execute this script to recreate test data after you execute a DELETE statement. VALUES ( 'Carine ', 'Schmitt', 'Jean', 'King', 'Peter', 'Ferguson', 'Janine ', 'Labrune', 'Jonas ', 'Bergulfsen', 'Janine ', 'Labrune', 'Susan', 'Nelson', 'Zbyszek ', 'Piestrzeniewicz', 'Roland', 'Keitel', 'Julie', 'Murphy', 'Kwai', 'Lee', 'Jean', 'King', 'Susan', 'Nelson', 'Roland', 'Keitel', language: SQL (Structured Query Language) ( sql ) INSERT INTO contacts (first_name,last_name,email) The following script creates table contacts and inserts sample data into the contacts table for the demonstration. Once the duplicates rows are identified, you may want to delete them to clean up your data.

#Phpmyadmin delete database entry how to#
In the previous tutorial, we have shown you how to find duplicate values in a table. Summary: in this tutorial, you will learn various ways to delete duplicate rows in MySQL.
