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 sharding?
Explain what is meant by replication of database?
Explain the microsoft sql server delete command? : SQL Server Architecture
Is sql server a database?
What is difference between clustered index and non clustered index?
Explain left outer join and right outer join?
What are the properties of the transactions?
How is foreign key related to primary key?
Why we use functions in sql server?
How do I perform an unattended install of sql server 2000?
What’s the distinction between dropping a info and taking a info offline?
What is the recovery model?
1. Tell me your daily activities 2. If sql server installation fails at time installation what will do 3. Where does the sql server installation log details are stored 4. After the installation what will you do for memory configuration 5. What is the difference between SQL max maximum memory and AWE memory 6. How will you configure AWE memory 7. How will setup an email alert for the backup job 8. After the SQL installation what are the jobs will you configure 9. What does –g mean in the sql startup parameter 10. What is the difference between Bulked log and Full recovery model 11. What is the difference between mirroring and log shipping 12. What are the steps to be followed before in-place up gradation 13. After installing the patch the sql server does not start and application team tells to rollback the changes .In this scenario what will you do
What is the command used to check locks in microsoft sql server?
What is difference between temp table and cte?