CHIL-ORACLE-唯一约束(unique)
生活随笔
收集整理的這篇文章主要介紹了
CHIL-ORACLE-唯一约束(unique)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
唯一約束
要求該列唯一,允許為空,但只能出現一個空值
1.唯一約束 ( unique )--例如1:create table test19(id number ,name varchar2(30) ,address varchar2(30) , primary key(id) , unique(address));---例如2:create table test20(id number primary key ,name varchar2(30) ,address varchar2(30) unique );--例如3:create table test21(id number primary key ,name varchar2(30) ,address varchar2(30) );--給建好的表加上唯一約束ALTER TABLE test21 ADD unique(address);
要求該列唯一,允許為空,但只能出現一個空值
1.唯一約束 ( unique )--例如1:create table test19(id number ,name varchar2(30) ,address varchar2(30) , primary key(id) , unique(address));---例如2:create table test20(id number primary key ,name varchar2(30) ,address varchar2(30) unique );--例如3:create table test21(id number primary key ,name varchar2(30) ,address varchar2(30) );--給建好的表加上唯一約束ALTER TABLE test21 ADD unique(address);
?
轉載于:https://www.cnblogs.com/ChineseIntelligentLanguage/p/6513263.html
總結
以上是生活随笔為你收集整理的CHIL-ORACLE-唯一约束(unique)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 使用go脚本向MySQL表中写入数据
- 下一篇: CHIL-ORACLE-主外键约束(pr