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
What do you understand by intent locks?
What are the different types of normalization?
List types of tables in SQL Azure?
In which files does sql server actually store data?
What is partition index in sql server?
Explain different types of collation sensitivity?
Explain ms sql server reporting services vs crystal reports?
How to use “drop” keyword in sql server and give an example?
What is the name of the Database which IBM mainframe uses?
Explain system scalar functions?
Explain datetimeoffset data type in sal server 2008?
What are the risks of storing a hibernate-managed object in a cache? How do you overcome the problems?
Define Joins?
What happens if date-only values are provided as date and time literals?
What is tcl in sql server?