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 a fill factor?
Stored Procedure returns data from multiple tables. How to access it in your ASP.Net code?
where the connection string store in the database
Explain the advantages of merge replication?
Describe in brief authentication modes in sql server.
Does group by or order by come first?
When setting replication, is it possible to have a publisher as 64 bit sql server and distributor or subscribers as a 32 bit sql server?
What is the significance of master, tempdb and model databases?
What is explicit mode in sql server?
How to change a login name in ms sql server?
How do I delete a sql server database?
What do you mean by 'normalization'?
Does an index slow down updates on indexed columns?
What is the optimization being performed in oracle and SQL Server?
How to delete duplicate rows from table except one?