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
What is save transaction and save point?
Tell me when is the update_statistics command used?
What is an execution plan?
Explain primary key, foreign key and unique key?
What is the difference between Normalization and De-normalization?
What is user-defined functions? What are the types of user-defined functions that can be created?
Explain about nested stored procedure?
How many types of the database links?
Can sql server 2016 run on windows 7?
What is multilevel indexing?
In what three ways is the return statement used in a stored procedure?
Which joins are sql server default?
Explain the dbcc pintable command when would you use it?
Explain tables in SQL Azure?
Call by value and call by reference in procedure and function, with NOCOPY.