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 select statements be used on views in ms sql server?
Can we create clustered index on composite key?
Explain left outer join and right outer join?
How to find Duplicate Records In table?
How to return the top 5 rows from a select query in ms sql server?
What does ss stand for sexually?
What is failover clustering overview?
What is not null constraint?
How to find related tables in sql server?
What is the difference between a view and a stored procedure?
What is the use of tempdb? What values does it hold?
Tell me about the approaches which you used to counter the DI problems.
List some case manipulation functions in sql?
What is impersonation? What are the different impersonation options available in ssas? : sql server analysis services, ssas
What is a DBMS, query, SQL?