oracle更新表的问题!
我想更新一张表中的一个字段,想指定值只能在10,37,43,1,55等这些没有规律的固定数字之间,sql该如何写呢? oracle?sql
[解决办法]
scott@ORA11GR2> create table abc (id int);
Table created.
scott@ORA11GR2> alter table abc add check (id in (10,37,43,1,55));
Table altered.
scott@ORA11GR2> insert into abc values(10);
1 row created.
scott@ORA11GR2> insert into abc values(11);
insert into abc values(11)
*
ERROR at line 1:
ORA-02290: check constraint (SCOTT.SYS_C0013039) violated
scott@ORA11GR2>