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 command do we use to rename a db, a table and a column?
what is database replication? : Sql server database administration
What is the difference between functions and stored procedures?
What are user-defined functions (udfs) in sql server?
What are the different acid properties?
What are the recovery models for a database?
What is the importance of a recovery model?
What are the new features of sql server 2008 r2 reporting service?
What is a system database and what is a user database?
How to change a login name in ms sql server?
Is mysql better than sql server?
How to Update from select query in sql server?
Explain Reporting Life Cycle?
What is 4nf in normalization form?
What is Replication?