ROW_NUMBER differences between 10g and 11g
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