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


Please Help Members By Posting Answers For Below Questions

What is database manager in db2?

769


What is schema in db2?

784


What is db2 bind?

818


What is db2 instance?

816


Explain how can you do the explain of a dynamic sql statement?

867


Are view updateable?

821


How can you validate Sql errors during cursor operation in db2 pgms and where do you code?

1986


What does db2 mean?

783


How many types of page locks can be held in db2?

822


How do I delete a column in db2?

872


What are sqlcodes –803,-805, -811, -818,-904,-911,-913,-101, +100?

961


What is the connection string to connect to the DB2 Database ?

873


What is the difference between db2 and oracle?

884


Discuss about db2 bind?

873


Name the lockable units in DB2?

906