Delete duplicate rows using MYSQL statement

Jyotishgher Astrology
By -
0

Delete duplicate rows using DELETE JOIN statement

MySQL provides you with the DELETE JOIN statement that you can use to remove duplicate rows quickly.
The following statement deletes duplicate rows and keeps the highest id:
The output is:
It indicated that four rows have been deleted. You can execute the query that find duplicate emails again to verify the delete:

EXAMPLE :


DELETE t1 FROM

 marriage_time t1 

INNER JOIN 

marriage_time t2 

WHERE

t1.SRNO < t2.SRNO AND t1.EMAIL = t2.EMAIL


Post a Comment

0Comments

Post a Comment (0)