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
Why do chiropractors use drop table?
What are the uses of db2 optimizer?
Define db2.
What is precompiler in db2?
What is the use of predicate?
What is difference between alias and synonym in db2?
Discuss about db2 bind?
Explain packages.
Can we update view in db2?
What is blu acceleration in db2?
File not opened because library is *PROD and debug is UPDPROD(*NO). ? what may be the reason? how to solve it..?
How do I add a column in db2?
What is db2 purescale?
I HAVE 500 ROW TO UPDATE I WOULD LIKE TO USE ROLLBACK ALONG WITH COMMIT.WHAT IS THE SYNTAX TO CODE COMMIT AND ROLLBACK FOR EVERY 100 ROWS.AND HOW THE CURSOR ROLLBACK TO THE LAST COMMITTING POINT.
How and when does the db2 enforces the unique key?