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
How fixed length strings are truncated and padded?
What is the chart in report?
What are the character string functions supported by sql server 2005?
What is a system database and what is a user database?
What functions can a view be used to performed?
What is a database table?
What are the different types of sql server replication? : sql server replication
How to define and use table alias names in ms sql server?
What action plan is preferred if sql server is not responding?
How to resolve the orphan use problem? : sql server security
Would you store your query in a ssrs report or a database server? State the reason why?
What is the user of Primary key?
How to write character string constants or literals in ms sql server?
How do I install only the client tools of sql server 2000?
Give the query of getting last two records from the table in SQL SERVER?