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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:20:24+00:00 2026-06-15T00:20:24+00:00

Possible Duplicate: Rownum not working with query I am running some tests for how

  • 0

Possible Duplicate:
Rownum not working with query

I am running some tests for how rownum works. Please could someone explain the output of the following queries – Specifically why the third query is returning 0 rows.

Query 1 – Returns 2456 rows

Select rownum, s.id, s.title, sv.version_id
from software s JOIN software_version sv on (s.id = sv.id);

Query 2 – Returns 100 rows

Select rownum, s.id, s.title, sv.version_id
from software s JOIN software_version sv on (s.id = sv.id)
where rownum between 1 and 100;

Query 3 – Returns 0 rows

Select rownum, s.id, s.title, sv.version_id
from software s JOIN software_version sv on (s.id = sv.id)
where rownum between 101 and 400;

Thanks

  • 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-15T00:20:26+00:00Added an answer on June 15, 2026 at 12:20 am

    rownum is only evaluated AFTER the row is fetched and other predicates are evaluated. that is the key. so if you say
    select * from table where rownum >= 2;

    it can never work, as it works like

    open cursor loop
      fetch row (rownum is evaluated as the last thing here)
        if fetched then rownum = rownum + 1
    end cursor
    

    if you request rownum starting from > 1 then its never true. to do pagination if you need to you have to code like

    select *
      from (select rownum r, t.*
              from your query tables
             order by ..)
     where r>=101 
       and rownum <= 400
    

    also read more here at ask tom

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: How do I calculate someone's age in C#? Maybe this could be
Possible Duplicate: Is there some ninja trick to make a variable constant after its
Possible Duplicate: Can you write object oriented code in C? Hi, can someone point
Possible Duplicate: Remove close button on jQueryUI Dialog? I am getting some problem to
Possible Duplicate: Difference of create Index by using include column or not using Edit:
Possible Duplicate: Difference Between Equals and == in which cases equals() works exactly like
Possible Duplicate: Matlab gives wrong answer Can anyone explain to me why the following
Possible Duplicate: oracle PL/SQL: sort rows I run this query: Select a.product, sum( case
Possible Duplicate: regex for URL including query string I have a text or message.
Possible Duplicate: Why not use tables for layout in HTML? Under what conditions should

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.