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
Explain hostprotectionattribute in sql server 2005?
Explain indexes disadvantages?
How to sort the query output with order by clauses in ms sql server?
What language is sql server written in?
What is the purpose of object explorer and its features? : sql server management studio
What is the difference between stored procedure and user defined functions?
Do you know what is openxml in sql server?
What does nvl stand for?
what is the difference between Delete and Truncate command in SQL
What are the events recorded in a transaction log?
What is analysis service repository?
Where sql server usernames and passwords are stored in a sql server?
What is the difference between osql and query analyzer?
How to recompile stored procedure at run time?
Is it possible to import data directly from t-sql commands without using sql server integration services? If so, what are the commands?