Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 830357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T04:01:52+00:00 2026-05-15T04:01:52+00:00

I have to fetch only 50 records at a time from database (DB2), for

  • 0

I have to fetch only 50 records at a time from database (DB2), for this I have been using Row_Number but now the persons are telling that this Row_Number is not stable and has bugs in it so now I have to write a different query for the same as I have to fetch only 50 records at a time.

So please can any body help me out for the same?

Thanks in advance.

The query which I have been using is

SELECT PLC.* 
FROM
     (SELECT 
          ROW_NUMBER() OVER (ORDER BY PRDLN_CTLG_OID) AS Row,
          PRDLN_CTLG_OID, 
          PRODUCT_LINE_OID      AS  PRODUCT_LINE_OID, 
          RTRIM(CATALOG_ID)             AS  CATALOG_ID,
      FROM 
          PROD_LINE_CATALOG 
      WHERE 
          PRODUCT_LINE_OID = :productLineOID AND ACTV_IND = 1 
      ORDER BY CATALOG_ID) PLC
WHERE  
    Row >= :startIndex AND Row <= :endIndex
ORDER BY 
    PLC.CATALOG_ID DESC 
WITH UR
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T04:01:52+00:00Added an answer on May 15, 2026 at 4:01 am

    use the fetch clause

    FETCH FIRST 50 ROWS ONLY
    

    edit

    It looks like you use a startIndex and endIndex value. I realize you compare these to Row, but do you have another index to compare? If not, and you insist on moving from Row_Number, maybe the table needs another index.

    Select PLC.* From (Select omitting row_number())
    Where yournewindex >= startIndex
    Fetch first 50 rows only
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a site now that have to fetch users feeds. But how
Consider this problem: I have a program which should fetch (let's say) 100 records
I have the following Query and i need the query to fetch data from
I'm trying to fetch some HTML from various blogs and have noticed that different
I have this code while($row = mysql_fetch_row($result)) { echo '<tr>'; $pk = $row[0]['ARTICLE_NO']; foreach($row
I have a stored procedure currently executing a complicated fetch that is frequently timing
Is it possible to have a MySQLi prepared statement within the fetch() call of
Have just started using Google Chrome , and noticed in parts of our site,
PLATFORM: PHP, mySQL & jQuery WHAT I HAVE: I have a Database table. Within
I have a POCO classes that I am using with NHibernate in a WCF

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.