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
Define declaration generator (dclgen).
How to view db2 table structure?
What is host variable in db2 cobol?
How does cobol compile db2 program?
What is database alias db2?
How can you validate Sql errors during cursor operation in db2 pgms and where do you code?
What is cursor with hold option in db2?
what is db2 restart?
What is a db2 tablespace?
On which levels locks can be applied?
What is buffer pool and list some of them?
what is the sqlcode -501
What is the syntax for FETCH in DB2 ?
Which command is used to remove all rows from a table?
What are host variables in db2?