Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2003
    Posts
    2

    Unanswered: db2 - offset equivalent

    Hi,

    I am wondering if db2 has an equivalent of postgres "offset" ...

    "OFFSET says to skip that many rows before beginning to return rows to the client. OFFSET 0 is the same as omitting the OFFSET clause. If both OFFSET and LIMIT appear, then OFFSET rows are skipped before starting to count the LIMIT rows that are returned."

    thanks in advance,
    sarsako.

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    There's not any equivalent as far as I am aware ...

    Maybe you can use the techniques described in the article

    http://www7b.software.ibm.com/dmdd/l...307balani.html

    to achieve what you want

    Cheers
    Sathyaram
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  3. #3
    Join Date
    Jul 2001
    Location
    Bangalore, India
    Posts
    28

    Re: db2 - offset equivalent

    Originally posted by sarsako
    Hi,

    I am wondering if db2 has an equivalent of postgres "offset" ...

    "OFFSET says to skip that many rows before beginning to return rows to the client. OFFSET 0 is the same as omitting the OFFSET clause. If both OFFSET and LIMIT appear, then OFFSET rows are skipped before starting to count the LIMIT rows that are returned."

    thanks in advance,
    sarsako.


    Hi
    try using "fetch first <number> rows only" at the end of ur select
    statement...

    reg
    Ravi

  4. #4
    Join Date
    Jul 2003
    Posts
    2

    Re: db2 - offset equivalent

    Originally posted by Ravi
    Hi
    try using "fetch first <number> rows only" at the end of ur select
    statement...

    reg
    Ravi
    "fetch first <number> rows only" isn't what i am after.

    i am needing to specify the "starting point" within the recordset ... e.g.

    select blah
    from blah
    limit 100 offset 200

    will grab me the first 100 records, starting from the 200th record.

    thanks,
    sarsako.

  5. #5
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    Re: db2 - offset equivalent

    tHE Closest I can think of is the rownumber() OLAP function

    Cheers

    Sathyaram
    Visit the new-look IDUG Website , register to gain access to the excellent content.

Posting Permissions

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