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

求教这样的ORACLE字段约束如何写
要求字段长度=11,且头3个字符必须为139、138、136,这样ORACLE字段约束如何写

------解决方案--------------------
create table test(x varchar2(100), 
constraint chk_xx check(length(x) = 11 and substr(x, 1, 3) in ('139', '139', '136'))
);