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
let's assume you have data that resides on sql server 6.5. You have to move it sql server 7.0. How are you going to do it? : Sql server database administration
What is a synonym for manipulation?
What the different types of Replication and why are they used?
What do you understand by coalesce in sql server?
What is normalization? Explain different forms of normalization?
How can a user-defined datatype be created?
Does partitioning help performance?
What is data source in connection string?
How can I track the changes or identify the latest insert-update-delete from a table?
What are diverse clauses that form a part of sql?
What are the different types of sql server replication? : sql server replication
What are the mathematical functions supported by sql server 2005?
Delete duplicate rows without using rowid.
How to perform key word search in tables?
Explain what are the restrictions while creating batches in sql server?