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 / cp

DELETE FROM emp WHERE ROWID NOT IN(SELECT MAX(ROWID) FROM
emp GROUP BY empno)

Is This Answer Correct ?    2 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why should one not prefix user stored procedures with ‘sp_’?

601


What is Dependency Injection and provide example?

626


Explain some stored procedure creating best practices or guidelines?

529


What do you understand by check constraint in sql server?

486


How to provide default values to function parameters?

607






Do you know concepts and capabilities of sql server?

588


How to use transact-sql statements to access the database engine?

546


Explain how dts is used to extract, transform and consolidate data?

589


Explain activity monitors

631


What is the difference between indexing and hashing?

556


How to find the service pack installed? : sql server database administration

556


Can sub report data source be different from that of the parent report?

105


You want to implement the one-to-one relationship while designing tables. How would you do it?

539


Explain datetime2 data type in sal server 2008?

549


How use inner join in sql server?

623