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 database manager in db2?
What is schema in db2?
What is db2 bind?
What is db2 instance?
Explain how can you do the explain of a dynamic sql statement?
Are view updateable?
How can you validate Sql errors during cursor operation in db2 pgms and where do you code?
What does db2 mean?
How many types of page locks can be held in db2?
How do I delete a column in db2?
What are sqlcodes –803,-805, -811, -818,-904,-911,-913,-101, +100?
What is the connection string to connect to the DB2 Database ?
What is the difference between db2 and oracle?
Discuss about db2 bind?
Name the lockable units in DB2?