Delete Duplicates in SQL Data

1. Using rowidSQL > delete from empwhere rowid not in(select max(rowid) from emp group by empno);This technique can be applied to almost scenarios. Group by operation should be on the columns which identify the duplicates.2. Using self-joinSQL > delete from emp e1where rowid not in(select max(rowid) from emp e2where e1.empno = e2.empno );3. Using row_number()SQL > delete... Continue Reading →

Create a website or blog at WordPress.com

Up ↑

Design a site like this with WordPress.com
Get started