How To delete duplicate record from a particular table?

Answers were Sorted based on User's Feedback



How To delete duplicate record from a particular table?..

Answer / deepa

For Example

sno names
1 arun
2 arun
3 arun
6 arun
7 bala
11 bala
12 guna
9 guna
14 guna
10 raj
13 raj

Table Name T1
Fields Names Sno,Names

Delete From t1 where sno not in
(select min(sno) from t1 group by names)

Is This Answer Correct ?    2 Yes 5 No

How To delete duplicate record from a particular table?..

Answer / parashu

Delete from <TableName> where <fieldName> in (select
<FieldName> from <TableName> Group By <FieldName> Having
(Count(<FieldName>)>1))

Is This Answer Correct ?    0 Yes 8 No

Post New Answer

More SQL Server Interview Questions

What are the purposes and advantages stored procedure?

0 Answers  


What is the difference between upgrade and migration in sql server?

0 Answers  


Why are sql functions used?

0 Answers  


how to retrive only second row from table in sql server 2000?

15 Answers   Cognizant, CTS,


What are the new features introduced in SQL Server 2000 (or the latest release of SQL Server at the time of your interview)? What changed between the previous version of SQL Server and the current version?

0 Answers  






Can you explain what is indexed view? How to create it?

0 Answers  


When is update_statistics command used?

0 Answers  


Can anybody explain me cold backup and hot backup?

3 Answers   TCS,


What is normalization 1nf 2nf 3nf?

0 Answers  


What is difference beteen Migration and Upgrdation?

7 Answers   Satyam,


What do you mean by the term 'normalization'?

0 Answers   Tech Mahindra,


check, not null,unique

2 Answers   IBM,


Categories