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 are the basic functions for master, msdb, model, tempdb and resource databases? : SQL Server Architecture
How to fine-tune reports?
What happens when converting big values to numeric data types?
Which are ddl commands?
Is sql server is free?
What are the dmvs?
How many ways to create table-valued functions?
How do we know if any query is retrieving a large amount of data or very little data?
What are the restrictions while creating batches in sql server?
Explain about extended stored procedure?
Is there any difference between primary key and unique with the not null condition?
What stored by the msdb?
What is de-normalization and what are some of the examples of it?
What is sqlservr.exe - process - sql server (sqlex?press)?
What does man by sql wildcard characters in sql server?