How will you delete duplicate records from a table?

Answer Posted / naresh.s

in DB2
first we need to know duplicate records in database file
like tmpfilep ,for that

select RRN(A) from tmpfilep A where field='fieldvalue'

here field means any fileld containd tmpfilep and
corresponding value.

once we execute the above query we will get relative record
numbers of each row and remember that numbers
now you can delete records based on these numbers

delete from tmpfilep A where rrn(A) in (234,341,642)

here 234,341,642 are sample record numbers

may be i am correct upto my knowledge.......

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is netezza database?

803


Why do chiropractors use drop table?

905


What are the different types of base tables?

804


What is a page in db2?

828


What is buffer pool and list some of them?

831


What is isolation level in db2?

797


How to compare data between two tables in db2?

876


What is the advantage in De-normalizing tables in DB2?

971


What is a db2 cursor?

836


Explain db2.

846


How do I import data from excel to db2?

858


How to view db2 table structure?

825


What is declare cursor?

860


What is the maximum length of sqlca?

1179


What is with ur in db2?

1065