how to delete duplicate rows from table in sql server
Answer Posted / sanjay kumar dinda
Deletion of Rows depends upon the different condition...
Consider based on n columns the entire recordset is
treating a duplicate... We can delete the duplicate by
using following method...
Add one column and set uniue values to that column..
ALTER TABLE TABLE1 ADD ID INT IDENTITY(1,1)
COnsider T contains 40 columns and based on C1,C2,C3 we
have to find the duplicate and we have to delete the same...
Delete T1
FROM TABLE1 T1,TABLE1 T2
WHETE T1.C1=T2.C1 AND
T1.C2=T2.C2 AND
T1.C3=T2.C2
AND T1.ID>T2.ID
I think this will help....
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Explain isolation levels that sql server supports?
what is the difference between count(*) and count(1) ?
tell me what are the steps you will take to improve performance of a poor performing query? : Sql server database administration
Where the sql logs gets stored? : sql server database administration
What is the recovery model?
What happens if ntwdblib.dll is missing on your machine?
How many replicas are maintained for each sql azure db?
What number sorts of privileges are accessible in sql?
How to check table values in sql server?
can any body tell me how to know the password of current user in sql server
What is ms sql server index?
How to enter unicode character string literals in ms sql server?
What is the difference between local and global temporary tables?
What number aggregate functions are accessible there in sql?
What is a fan-out query in SQL Azure?