Results 1 to 4 of 4

Thread: pagination

  1. #1
    Join Date
    Jun 2004
    Posts
    3

    Unanswered: pagination

    select * from ( select a.*, rownum rnum from (select job, empno from emp order job asc) a )where rnum>=5 and rnum<7

    This is query used to retrieve rows 2 rows, i.e., the 5th and 6th rows from the complete query run above. Of course, this is in oracle, but is there a way to do this using db2?

    Please let me know, I have been looking for this for a while now.

    Thanks.

    V.

  2. #2
    Join Date
    Apr 2003
    Location
    Singapore
    Posts
    59
    hi,

    SELECT * FROM (SELECT firstNAME, rownumber() OVER (ORDER BY firstNAME) AS rn FROM user) AS tr WHERE rn BETWEEN 11 and 20

    Hope it helps...
    p.nee “OLAP Functions in the SQL Reference” for fancy stuff like rownum and rank

    Cheers
    brat.

  3. #3
    Join Date
    Jun 2004
    Posts
    3

    Does not work on z/os

    Hi,

    The query you suggested works on db2 on pc but not on db2 7.1.1 on z/os. any ideas?

    Thanks.

  4. #4
    Join Date
    Apr 2003
    Location
    Singapore
    Posts
    59
    sorry dude not into z/os but the following link may give u some insight

    http://www.idugdb2-l.org/adminscript...&F=&S=&P=15547

    sorry to know that this link also ends in a dead end... If (only if) i do find somthing ' else i'll post it here.. check this thread in the next 24 hrs

    cheers
    brat

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •