Delete duplicate Entries from DB
How to delete duplicate entries from Database
<!-- Use Inner join to delete the duplicates
Table Contacts
-------------------------------------------------------
| ID | FIRST_NAME | LAST_NAME | EMAIL | AGE |
-------------------------------------------------------
| 1 | Rahul | K | rahul@gmail.com | 25 |
| 2 | Rahul | K | rahul@gmail.com | 25 |
| 3 | Vinay | Kumar | vinay@gmail.com | 28 |
-------------------------------------------------------
Query:-->
delete c1 from Contacts c1
INNER JOIN
Contacts c2
where (c1.id < c2 xss=removed> 1); >> This query returns the rows where email is duplicated.