How to delete the duplicate records in a table using sql
server

Answers were Sorted based on User's Feedback



How to delete the duplicate records in a table using sql server..

Answer / mohamed idhris

SET ROWCOUNT 1

DELETE FROM tbl_name WHERE field_name= 'field_value'

SET ROWCOUNT 0


the above query will delete the duplicate row

Is This Answer Correct ?    4 Yes 2 No

How to delete the duplicate records in a table using sql server..

Answer / rakesh pattajoshi

delete from tbl where id not in(select max(id) from tbl group by name)

Is This Answer Correct ?    0 Yes 0 No

How to delete the duplicate records in a table using sql server..

Answer / priya

use distinct.it removes the duplicate rows

Is This Answer Correct ?    0 Yes 0 No

How to delete the duplicate records in a table using sql server..

Answer / ranjitha

Add Primary Key to the table.

Is This Answer Correct ?    2 Yes 9 No

Post New Answer

More Dot Net AllOther Interview Questions

Explain the number or character entered through keyboard gets converted to equivalent ascii code & it get stored on ram in the binary form. What is the exact procedure on hardware that converts the ascii value to binary? : .NET Architecture

1 Answers  


Explain the number or character entered through keyboard gets converted to equivalent ascii code & it get stored on ram in the binary form. What is the exact procedure. : Dot net architecture

1 Answers  


What is the purpose of Treeview control?

1 Answers   CGI,


What is the purpose of hard disk? : Dot net architecture

1 Answers  


Explain difference between machine config vs. Web config? : .NET Architecture

1 Answers  


Define cache coherency and how is it eliminated? : Dot net architecture

1 Answers  


Explain about httpruntime.cach.get(); method?

1 Answers   Tech Mahindra,


What is .net mobile automatic paging? : Microsoft dot net mobile

1 Answers  


Explain Singleton design pattern in .net

1 Answers   Infosys,


How can a win service developed in .NET be installed or used in Win98?

1 Answers  


Explain domestic architecture artifacts? : .NET Architecture

1 Answers  


How is the using() pattern useful? What is idisposable?

1 Answers  


Categories