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

  • Home
  • SEARCH
  • 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 6244339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:18:34+00:00 2026-05-24T12:18:34+00:00

I am facing a wierd problem where the same query is returning different results.

  • 0

I am facing a wierd problem where the same query is returning different results.

My query is:

SELECT * FROM TX_HISTORY  WHERE acct = 7  AND ROWNUM 

What is happening is that I know that for this account there are more than 100 records in tx_history. I want to get the first 100 records based on the processing date.
My data for this account is I have records from 2004 till 2011

The problem is sometimes it correctly shows the 100 records starting 2004 – but sometimes it shows me 100 records starting 2005

I read that this can be solved by:

SELECT * FROM (select * from TX_HISTORY  WHERE acct = 7  ORDER BY acct,processing_date)
where rownum 

so in my earlier query is it that the:
1> My understanding is that the order by is being applied after the rownum <= 100 and the results returned by oracle are in a random order on which row num is filtering

Though what is not understood why the results would vary
Thanks,
~akila

  • 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-24T12:18:34+00:00Added an answer on May 24, 2026 at 12:18 pm

    If you do not specify any ordering (and in this case, as you already found out, you do not order the data being retrieved, you only sort afterwards), it is up to the database to return them in any order it sees fit.

    It could for example just start reading the rows in the order they are stored, which changes as the data gets updated. It also does not have to start from the top of the table, it could start with the blocks already in the buffer cache.

    Since you did not specify the order, the DB will choose (what it thinks to be) the least expensive way available to it at this particular moment.

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

Sidebar

Related Questions

I am facing problem with an Oracle Query in a .net 2.0 based windows
I'm facing a problem with IE6. I took the toggle function from this website
I am facing a weird problem in production, not happening in Local machine. I
I am facing a weird problem: I am encrypting the contents of a cookie.
I am facing a weird problem on BlackBerry JDE 4.2.0 and the 8100 simulator
In my 2nd ASP.NET MVC project I'm facing a very weird problem: when I
When facing the problem of validating a property in a JSF2 application there are
I am facing a problem with .NET generics. The thing I want to do
I have a public facing website that has been receiving a number of SQL
I am facing a weird problem I have defined I a structure in a

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.