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

What is sqlca’s maximum length?

674


I have a subprogram B calling from mainprogram A.I have opened a cursor in A ,Can i fetch the same cursor in subprogram B , If yes , Please explain the reason?

1938


How to check table size in db2 sap?

577


List down the data types in the db2 database.

632


What is db2 catalog database?

582






What are catalog tables in db2?

606


What is the difference between spufi and qmf?

639


What is reorg and runstats in db2?

694


What are bind parameters in db2?

611


How to view db2 table structure?

589


What is the use of commit in db2?

630


what are bind concepts in db2 cobol?

649


Mention the location where the output received from explain statement is stored.

628


How many databases can be created inside an instance in db2 ?

599


How do I import a csv file into db2?

560