DB2 Row selection



IBM's flagship relational database management system

DB2 Row selection

Postby ram23bal » Thu Sep 25, 2008 1:36 pm

Hi All,

In table i have to select only from 100 th row to 1000th row. Say Table has 5000 rows. Can anyone help me...?
ram23bal
 
Posts: 32
Joined: Sat May 24, 2008 3:57 pm
Has thanked: 0 time
Been thanked: 0 time

Re: DB2 Row selection

Postby dick scherrer » Fri Sep 26, 2008 1:56 am

Hello,

Tables do not have a 100th row. . . If you want some unpredictable set of rows you could declare a curaor for the table, open the cursor, fetch and ignore 100 rows, continue to fetch rows and process them until you reach 1000 and then close the cursor.

This will get the number of rows you said you want, but is not worth much as a solution. If the query is run again later, the rows used are likely to be a different set of rows.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post