Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Does row_number() returns different result set every time?

NandiniSep 20 2011 — edited Sep 21 2011
Hi,

I have a query somewhat like the example:

select /*+ parallel (ftstm,4) */
ftstm. term,
sum(ftstm.revenue) revenue,
sum(ftstm.searches) searches,
row_number() over (order by sum(ftstm.revenue)desc) as depth_rank
from
fact_terms
group by
ftstm.term
ORDER BY
revenue DESC
)
where
depth_rank <= 100000

I have run this query 2-3 times and surprisingly- when I do MINUS on the result sets, I got few records.

Is that possible or am I doing some mistake with this query? Please help...
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 19 2011
Added on Sep 20 2011
4 comments
2,119 views