暂无图片
分享
马老师r
2020-11-27
oracle 主键唯一索引,约束一直生效的,索引状态为有效。但有重复值。什么原因呢?
暂无图片 10M

oracle 主键唯一索引,约束一直生效的,索引状态为有效。但有重复值。什么原因呢?

收藏
分享
3条回答
默认
最新
侯志清

索引是单列主键还是多列主键?查重复值是怎么查询出来的?

暂无图片 评论
暂无图片 有用 0
侯志清

SQL> create table test11(id int,name varchar2(20));

Table created.

SQL> create index p_test11 on test11(id);

Index created.

SQL> insert into test11 values(1,‘user1’);

1 row created.

SQL> insert into test11 values(1,‘user1’);

1 row created.

SQL> commit;

Commit complete.

SQL> alter table test11 add constraint uk_t_1 unique (id) deferrable enable novalidate;

Table altered.

如果主键创建时按照这种方式是可以出现重复值的。

暂无图片 评论
暂无图片 有用 0
侯志清
问题已关闭: 问题已经得到解决
暂无图片 评论
暂无图片 有用 0
回答交流
提交
问题信息
请登录之后查看
邀请回答
暂无人订阅该标签,敬请期待~~
暂无图片墨值悬赏