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 happens when the SQL Azure database reaches Max Size?
Detail about query optimizer?
You have several tables, and they are joined together for querying. The tables contain both clustered indexes and non clustered indexes to optimize performance, how should you distribute the tables and their indexes onto different file groups?
Explain the xml support sql server extends?
Do you think BCNF is better than 2NF & 3NF? Why?
What is an indexing strategy?
how you can move data or databases between servers and databases in sql server? : Sql server administration
What is sql server english query?
How to delete duplicate rows from table except one?
What are different types of join?
Can a trigger be created on a view?
What are the advantages dts has over bcp?
What are the new features of sql server 2012 reporting service?
Explain important index characteristics?
What is transactional replication?