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 the difference between spufi and qmf?

813


Which command is used to remove all rows from a table?

769


What does db2 plan contain?

754


What is query_cache_limit?

745


Mention the way of highlighting as well as putting a cursor to use in a cobol program.

833


Is db2 relational database?

732


What is copy pending status in db2?

868


What are the various data types available in db2?

812


What is the maximum number of columns in a db2 table?

979


Define sqlca.

844


List some fields from sqlca?

799


Explain about cursor stability?

784


What is the usage of open cursor command?

781


What is the difference between using bind () and rebind () methods of naming class?

1068


What is consistency token in db2?

867