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 8296475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T15:01:18+00:00 2026-06-08T15:01:18+00:00

I am retrieving data from table but instead of all row, I want 20

  • 0

I am retrieving data from table but instead of all row, I want 20 rows at a time for pagination. For this I use limit keyword which work perfectly in Mysql but not in Oracle.

Code:

"select "+  "C.CONTRACTOR_ID,C.CONTRACTOR_NAME,nvl(C.CONTACT_PERSON_1,'-'),nvl(C.CONTACT_PERSON_2,'-'),C.REGISTRATION_NO,CRA.DESCRIPTION REG_AUTH_NAME,"+
            "to_char(C.VALID_FROM,'dd/mm/yyyy'),to_char(C.VALID_TO,'dd/mm/yyyy'),CC.DESCRIPTION CONTRACTOR_CLASS,C.INCORP_PLACE,"+
            "IT.DESCRIPTION INCORP_TYPE,nvl(to_char(C.DATE_OF_INCORP,'dd/mm/yyyy'),'-') DATE_OF_INCORP,C.ADDRESS1,nvl(C.ADDRESS2,'-'),nvl(C.EMAIL_ID,'-'),"+
            "nvl(C.WEBSITE_URL,'-'),nvl(C.PHONE_NO,'-'),nvl(C.FAX_NO,'-'),nvl(C.MOBILE_NO,'-'),C.BANK_NAME,C.BANK_BRANCH,C.ACCOUNT_NO,C.IFSC_CODE," +
            "C.PAN_NO,nvl(C.TIN_NO,'-'),nvl(C.CST_NO,'-') "+ 
"from "+
            "CONTRACTOR C "+  
            "inner join CONTRACTOR_REG_AUTH CRA on CRA.REG_AUTH_ID=C.REG_AUTH_ID "+
            "inner join CONTRACTOR_CLASS CC on CC.CLASS_ID=C.CONTRACTOR_CLASS_ID "+
            "inner join INCORPORATION_TYPE IT on IT.INCORP_TYPE=C.INCORP_TYPE "+
"limit " + offset + ", " + noOfRecords ";

Here no order by keyword is there. I am retrieving data from different table and then display only 20 rows at a time.

  • 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-06-08T15:01:21+00:00Added an answer on June 8, 2026 at 3:01 pm

    In Oracle, you can use the special rownum variable. This example behaves like limit FirstRow, NrOfRows:

    select  * 
    from    ( 
            select  *
            ,       rownum as rn 
            from    YourTable
            order by
                    id
            ) as SubQueryAlias
    where   FirstRow <= rn 
            and rn < FirstRow + NrOfRows
    

    An optimized version of this query from AskTom, linked from this SO question:

    select  * 
    from    ( 
            select  /*+ FIRST_ROWS(n) */ 
                    rownum as rn
            ,       *
            from    (
                    select  *
                    from    YourTable
                    order by 
                            id
                    ) as SubQueryAlias1
            where   rownum <= FirstRow + NrOfRows
            ) as SubQueryAlias2
    where   rn >= FirstRow
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently, I'm retrieving some data from a MySQL database table, but the problem is
I'm retrieving data from a MySQL table and displaying it on a webpage using
I have written this query for retrieving data from mysql as below select FeedbackCode,EMailID,FeedbackDetail,
I'm retrieving data from database and display it inside textarea in table format, I
I'm have little problem in retrieving the data from a table here's the code:
how do i efficiently copy a row data from one table to another table,
I am retrieving data from an Oracle database and binding the same to a
Traditionally when using a DbCommand when retrieving data from a sproc, something like the
For some reason I'm having a problem retrieving data from my database. It leaves
I have developed a VB.Net code for retrieving data from excel file .I load

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.