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 a trigger? Why we need it?
I applied Transactional with updatable subscriptions replication on 2 tables now i want to delete those 2 tables but i cannot delete those tables as replication is running how can i stop replication for those 2 tables(but i don't want to delete those replicated tables but i need to stop the replication) how can i do that
Can We Use Data-grids For Our Report In Ssrs?
How to add more data to the testing table in ms sql server?
What are the indexes in sql server?
What is the difference between DataRow.Delete() and DataRow.Remove()?
What is plan freezing?
What is enhanced database mirroring in sql server 2008?
What is tabulation?
What is the default server name for sql server?
How can I add Reporting Services reports to my application?
Why do we use stored procedures in sql server?
Explain what is scheduled job and how to create it?
What is the most common trace flags used with sql server?
What is Sqlpaging in SqlServer 2005 ?