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
Why functions are used in sql server?
Explain what is analysis service repository?
Which event (check constraints, foreign key, rule, trigger, primary key check) will be performed last for an integrity check?
What is the advantage of sql server?
What is the rdl file?
How to get the definition of a view out of the sql server?
How do you identify a foreign key?
What is data set in report?
List out different types of normalizations in sql server and explain each of them?
What type of Index will get created after executing the above statement?
you have developed an application which uses many stored procedures and triggers to update various tables users ocassionally get locking problems which tool is best suited to help you diagnose the problem? : Sql server administration
Suppose i have a table that contains 5 columns like col1,col2...colm5.I want to import only two column through BCP utility.How to do same through BCP in sybase.
Does server sql treat char as a variable-length or fixed-length column?
How to create user defined functions with parameters?
What is inner join in sql server joins?