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 types of tables are there in the db2 database?

654


Explain correlated sub-queries.

663


List out the buffer pools in db2

722


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

749


What is the syntax for creating a table in the db2 database?

719






How do we specify index to include or not during bind process.

1764


What is dclgen (declaration generator)?

694


What is the syntax for seeing the columns and data types of a table in the db2 database?

657


What is data manager?

695


What does db2 blu stand for?

759


What is a db2 package?

681


If the cursor is kept open followed the issuing of commit, what is the procedure to leave the cursor that way?

800


What is host variable in db2 cobol?

706


How do I import a csv file into db2?

649


What is database reorganization?

679