Click here to Skip to main content
15,920,603 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have one table in that some rows are duplicated(not all rows) one,two or three times so how to remove the rows that repeated more than ones in the table..please give one solution for this..
Posted

1 solution

There are many ways:
SQL
WITH tblTemp as
(
SELECT ROW_NUMBER() Over(PARTITION BY Col1,Col2 ORDER BY Col1)
   As RowNumber,* FROM [table_name]
)
DELETE FROM tblTemp where RowNumber >1

Or follow the link Delete duplicate rows[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900