问题
I am facing a problem on how to set a new column to unique using Oracle 11g.
I try to use this code but it getting error:
ALTER TABLE QAS_ASSIGNED_STATE ADD UNIQUE (cuid);
回答1:
You should define column's type. Like this:
alter table
QAS_ASSIGNED_STATE
add
cuid number NULL;
and then add constraint:
ALTER TABLE QAS_ASSIGNED_STATE ADD CONSTRAINT constraint_cuid UNIQUE (cuid );
来源:https://stackoverflow.com/questions/36030261/oracle-11g-add-new-column-and-set-as-unique