How to delete duplicate records from a table?(for suppose in
a table we have 1000 Records in that we have 200 duplicate
Records , so ,how to findout that duplicate Records , how to
delete those Records and arranged into sequence order? one
more thing that there is no primary key at all)
Answer Posted / smitha
;with empctc(empid,ename,sal,deptid,ranking)
as
(Select empid,ename,sal,deptid,ranking=Dense_rank() over (
partition by empid,ename,sal,deptid order by NEWID() asc)
from emp
)
delete * from empctc where ranking>1
Is This Answer Correct ? | 2 Yes | 5 No |
Post New Answer View All Answers
Explain the stored procedure?
How will you monitor replication activity and performance? What privilege do you need to use replication monitor? : sql server replication
you accidentally delete the msdb database what effect does this have on your existing sql databases, and how do you recover? : Sql server administration
Explain “@@rowcount” and “@@error” in sql server?
What is change data capture (cdc) feature?
What is the tcp/ip port on which sql server runs?
What is fill factor and pad index?
What is the purpose of floor function?
How to list all schemas in a database?
Can we create clustered index on composite key?
What is the optimal disk configuration for a database server and what raid configurations would you use if budget is not a constraint?
What types of Joins are possible with Sql Server?
Write the queries for commands like Create Table, Delete table, Drop Table etc.
How can you stop stored procedures from recompiling?
What is raid? : SQL Server Architecture