how to delete duplicate rows in sql server2005

Answer Posted / surendra pal singh

delete from tablename where empname in (select empname from table name group by empname having empid>1)

where empname and empid are the columns of the table.
definately it will work

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between count () and rowcount ()?

516


you have a table with close to 100 million records recently, a huge amount of this data was updated now, various queries against this table have slowed down considerably what is the quickest option to remedy the situation? : Sql server administration

536


What do you understand by a stored procedure?

595


What objects does the fn_my_permissions function reports on? : sql server security

551


What are the options which must be set to allow the usage of optimistic models?

507






you have couple of stored procedures that depend on a table you dropped the table and recreated it what do you have to do to reestablish those stored procedure dependencies?

577


Tell me about builtinadministrator?

558


Can primary key be a foreign key?

558


What are the restrictions that views have to follow? : SQL Server Architecture

527


You have modified 100 store procedures and want to replicate these changes from development to prodution, and production can have users using the Server/DB, how would you replicate without causing issues?

1720


Please explain what is “asynchronous” communication in sql server service broker?

506


Explain the steps needed to create a scheduled job?

520


What is the usage of the sign function?

524


What is log shipping?

558


What are the basic features of a trigger in ms sql server?

565