oracle給表添加索引 在什么情況下建表能自動生成(唯一)索引ORACLE數(shù)據(jù)庫中?
在什么情況下建表能自動生成(唯一)索引ORACLE數(shù)據(jù)庫中?創(chuàng)建表并定義主鍵將自動創(chuàng)建唯一索引。(因?yàn)橹麈I=not null unique)例如SQL> create table testuuuC
在什么情況下建表能自動生成(唯一)索引ORACLE數(shù)據(jù)庫中?
創(chuàng)建表并定義主鍵將自動創(chuàng)建唯一索引。(因?yàn)橹麈I=not null unique)
例如
SQL> create table testuuuCreateuu1(
2 id int,
3 Val varchar(10),
4 primary key(id)
5)
table created。
或者,在創(chuàng)建表時(shí),為指定字段定義唯一約束。Unique
然后數(shù)據(jù)庫會自動為這個(gè)字段創(chuàng)建一個(gè)唯一的索引。