Write a query to delete duplicate records in SQL SERVER
Answer Posted / vaishali
set rowcount 1
delete from stud
where (select count(*) from stud a where stud.roll_no =
a.roll_no) > 1
while @@rowcount<>0
delete from stud
where (select count(*) from stud a where stud.roll_no =
a.roll_no) > 1
set rowcount 0
| Is This Answer Correct ? | 3 Yes | 6 No |
Post New Answer View All Answers
can a database be shrunk with users active? : Sql server administration
Disadvantages of the indexes?
What is the difference between a local and a global temporary table?
Which is the latest version of sql server and when it is released?
Do you know the isolation level that sql server support?
What is the maximum size of sql server database?
What is the use of for clause?
Why use cursor in sql server?
query processing
What the different components in replication and what is their use?
How to write a query with a left outer join in ms sql server?
Define cross join in sql server joins?
Sql studio em braces a variety of capabilities, but will I need them all? Is there a simpler product ? : sql server management studio
What causes index fragmentation?
Which are the important points to note when multilanguage data is stored in a table?