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
Is it possible using max on a char column?
How can you count the number of rows from a table tab?
What is dbrm? What it contains? When it will be created?
What is with ur in db2?
What is a system catalog table in db2?
When a COBOL-DB2 program in PRODUCTION is updating main tables and gone for long run, what have to do?
What is dclgen (declaration generator)?
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.
What is the advantage in De-normalizing tables in DB2?
What is a dbrm in db2?
What is a db2 package?
What is the use of with ur in db2?
What is the physical storage length of the data types: date, time, timestamp in the db2 database?
What is host variable?
What is the syntax for FETCH in DB2 ?