SQL Language (MOSC)

MOSC Banner

On some Oracle instances wrong order of result

edited Aug 3, 2016 11:02AM in SQL Language (MOSC) 10 commentsAnswered

On some of our Oracle instances the ordering of a result does not work properly when selecting from a partitioned table with local primary key.

Here a small example.

Table Creation

-- SQL*Plus: Release 11.2.0.4.0 Production

create table ORDER_TEST

(ID  number(1)

,VAL number(1)

,constraint ORDER_TEST_PK

            primary key (ID,VAL)

            using index (create unique index ORDER_TEST_PK

                         on ORDER_TEST(ID,VAL)

                         local -- global: result is ordered correctly

                        )

            enable

)

partition by range (ID)

interval(1)

(partition negative values less than (0))

;

insert into ORDER_TEST values (0,0) ;

insert into ORDER_TEST values (0,1) ;

commit ;

Data Selection

Please note the different ordering of the second result.

Tagged:

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center