Wednesday, 26 December 2012

Delete Duplicate Rows From Table


If your table become like this


id name salary no

1abc10001
2xyz20002
3pqr30003
4abc10001
5xyz20002
6pqr30003

 then you can remove duplicate row by using T-sql statement


DELETE
FROM  tbl_Duplicate
WHERE ID IN
(
SELECT MAX(ID)
FROM tbl_Duplicate
GROUP BY no
)



No comments:

Post a Comment