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
What is the difference between spufi and qmf?
How can we retrieve the total number of records in RPG & CLLE?
Can we update view in db2?
What is a dbrm in db2?
How to check last update on table in db2?
Which isolation level provides maximum concurrency?
What is the role of the data page in the db2 database?
What is package in cobol db2?
What is the use of commit in db2?
What is the result of open cursor statement?
What is the difference between oracle and db2?
Differentiate between cs and rr isolation levels? Where do you specify them?
Can one database have multiple instances?
Explain about rct in db2?
Where can you declare a cursor in a cobol-db2 program?