我需要在表上创建一个唯一的检查,sql是这样的:
alter table SAMPLE
add constraint A_B unique (A, B)
using index
tablespace MASCITY
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
它会自动创建一个唯一索引,但我需要的是a asc和b是desc的索引,就像:
create index A_B_Index on SAMPLE (a asc,b desc);
如何把我的sql字符串?
答案 0 :(得分:0)
alter table MY_TABLE add constraint UK_X unique (A, B)
using index (create unique index UK_X on MY_TABLE(A asc, b desc));