How will you delete duplicate records from a table?

Answer Posted / king

DELETE FROM FILE WHERE FIELD = ALL(SELECT FIELD FROM FILE
GROUP BY FIELD HAVING COUNT(*) > 1)


OR


DELETE FROM FILE WHERE FIELD = ANY(SELECT FIELD FROM FILE
GROUP BY FIELD HAVING COUNT(*) > 1)

Is This Answer Correct ?    1 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a Foreign Key?

876


Explain in brief how does db2 determine what lock-size to use?

811


Is the primary key a clustered index?

862


How does db2 sample database connect?

804


How to access db2 tables in mainframe?

836


What are packages in db2?

815


What is the connection string to connect to the DB2 Database ?

891


What is the usage of open cursor command?

817


How can you find out the # of rows updated after an update statement?

886


How can you quickly find out the # of rows updated after an update statement?

824


Highlight all the advantages that are attached to a package.

917


What is the syntax for creating a table in the db2 database?

902


Define data page.

848


Differentiate between cs and rr isolation levels? Where do you specify them?

846


What does db2 blu stand for?

919