日期:2014-05-17  浏览次数:20937 次

orcale设置最大值
orcale中可以设置一个列的最大值为3吗?
------最佳解决方案--------------------

--用check約束就可以了,如
create table t(col1 number check(col1<=3));
--成功
insert into t values(3);
--失敗
insert into t values(4);

------其他解决方案--------------------
引用:
SQL code


--用check約束就可以了,如
create table t(col1 number check(col1<=3));
--成功
insert into t values(3);
--失敗
insert into t values(4);



++
------其他解决方案--------------------
好的,谢谢了