First,You need to update your"Relational"Knowledge about database management systems.No"Top"Or"Bottom"OfNConcept of rows.However, the result set has the concept of "TOP" or "bottom "..You can useFETCH FIRST N ROWS ONLYClause to get the startNRows,But getNRows are more difficult.To achieve this,You need to use a scroll pointer.The scroll pointer allows you to read/All rows are moved before and after the result set. I suggest you readDB2 SQLReference manual andDB2The content of the scroll pointer in the application manualDB2The manual can be downloaded free of charge from the Internet ). Basically, you should use a scroll pointer.FETCH LASTStatement, and then useFETCH PRIORStatement LoopN-1Times. That will give any result set"Bottom"
OfNRows or unclassified rows ).
I don't understand why you want to delete your other questions from the chart.NRows. What is the data in these rows important? I guess you are asking howDELETEOfWHEREThe answer is no. You mustWHERESpecify the conditionsFOR UPDATETo open a pointer, and then you needNThe next line opensFETCHAndDELETE WHERE CURRENTPointer. Of course, this means you have to rewrite a program.