Oracle: How to create a “reverse” index primary key

indexoracleprimary-key

I can create a primary key for a table and then reverse it with the command

alter index T_PK rebuild reverse online;

How can I create it reversed?

Best Answer

The primary key index (including index parameters) can be specified with the using index clause. You can include the reversed specification there.

create table T(X number primary key
                 using index (create unique index T_PK on T(X) reverse));