使用oracl数据库用
ALTER TABLE Students
ADD CONSTRAINT PRINF_NAME_UNIQUE UNIQUE (sname)
添加唯一性约束,出现问题,报错为:an alter table validating constraint failed because the table has duplicate key values.
百度了一下找到问题,只要改为
ALTER TABLE Students ADD CONSTRAINT PRINF_NAME_UNIQUE UNIQUE (sname) deferrable initially deferred NOVALIDATE;
详细的看链接:https://www.e-learn.cn/content/wangluowenzhang/492198