1、
create table t1(a int primary key,b int);
alter table t1 add constraint test unique (b);
2、
create table t1(a int);
create unique index test on t1(a) ;
create table t1(a int primary key,b int);
alter table t1 add constraint test unique (b);
2、
create table t1(a int);
create unique index test on t1(a) ;
解决方案 »
- 如何知道当前用户已经具备了哪些权限
- Oracle创建用户的问题:
- RHEL9上安装Oracle 9i,所需要的补丁在哪可以下得到?
- Oracle Job
- 高分求一条SQL语句,关于用户字典
- oracle数据库表设计的问题
- 我发觉在存储过程里select field into 变量 from dba_XXX,会报table OR view不存在的错
- 为什么Oracle下JDBC这么慢?
- 谁能解释一下函数:lag和lead的用法?急!!!
- 如何从数据表中SELECT出字段为空,但不为.NULL的数据??急急急,等。。。
- 类型变换问题,麻烦给出示例。
- oracle中有没有根据整数转换成asc字符的函数啊
SQL> alter table t add bbb number unique;表已更改。
create table aa(id int unique);
如果表存在:alter table aa add constraint a_p unique(id)