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!

ROW_NUMBER differences between 10g and 11g

User909022Jun 21 2012 — edited Jun 21 2012
Hi and apologies if this has been previously answered, I searched but could not find a relevant answer.

I have a simple table: X

Address Entity Source
13534780 547045234 A
5903573 547045234 A
9805116 582004049 A
9808958 582004049 A
6429371 583032305 A
6669148 583032305 A

When I run the following SQL:

select Address,Entity,row_number() over (partition by Entity order by Source) as RN from X;

Oracle 10g yields:

Address Entity RN
5903573 547045234 1
13534780 547045234 2
9805116 582004049 1
9808958 582004049 2
6429371 583032305 1
6669148 583032305 2

whereas 11g yields:

Address Entity RN
13534780 547045234 1
5903573 547045234 2
9808958 582004049 1
9805116 582004049 2
6669148 583032305 1
6429371 583032305 2

If I repeat these runs , they are always consistent within each version of the database which is what I would expect.

Is this due solely to the order the table rows have been loaded and how can I within the query ensure parity between the two versions.

Thanks.

Edited by: User909022 on 21-Jun-2012 03:31
This post has been answered by 908002 on Jun 21 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 19 2012
Added on Jun 21 2012
7 comments
1,040 views