Delete duplicate records from the table?(Table must have
unique id)
Answer Posted / brijesh darmwal, sandhya
DELETE FROM [MyDb].[dbo].[sandhya]
WHERE id
IN
(SELECT id
FROM
(SELECT MAX(id) as id,name,addr
FROM [MyDb].[dbo].[sandhya] GROUP BY name,addr having
count(id)>=2)
Tmp)
| Is This Answer Correct ? | 7 Yes | 16 No |
Post New Answer View All Answers
What is bcp? When does it use?
What is replication and database mirroring?
What is logshipping and its purpose?
How to set database to be single_user in ms sql server?
what is the system function to get the current user's user id? : Sql server database administration
Mention what are the different types of ssrs reports?
What is the difference between MVC and Teir Architecher? Plz explain with Layyered Programming example...? Thanks
How to rebuild master databse?
Write a program to fetch first 10 records from a file?
What is set nocount on and what is set nocount off?
What is difference between Datepart() and Datename() in SqlServer?
as a part of your job, what are the dbcc commands that you commonly use for database maintenance? : Sql server database administration
What is the tcp/ip port on which sql server runs?
What are a database and a data warehouse?
What is DCL?