In my table having 100 Rec. How can I delete the 7th row??
(we don't know what is data inside the table)

Answer Posted / harsha

Use DELETE FROM TabName

The above command will delete all rows of the table with
out deleting the table.

Now if we want to delete 7th row and we don't know the
actual data in that row, then in that case we need to
create a new temporary result table, that contains only one
desired record which you want to delete.
Here are the steps.

1 Select only 7 row data.
2 Sort it in descending order(ORDER BY calue)
3 Select only first row
4 Now you have a result table with only 1 and desired record

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Name the various locking levels available?

630


What is a storage group (stogroup)?

772


What is difference between rollback and commit?

616


What is runstats utility in db2?

567


What are the various isolation levels possible?

643






What is reorg and runstats in db2?

686


What is cloudant database?

641


What do you mean by cursor?

580


what is the sqlcode -501

11278


What is page size in db2?

559


What is rebind in db2?

572


What type of database is db2?

521


List out the data types available.

694


Explain package in db2 and its advantages?

589


What is the clustering index in the db2 database?

580