开发者

Oracle null constraint

开发者 https://www.devze.com 2023-03-02 08:52 出处:网络
I have an email and cellPhone attrib开发者_StackOverflow社区utes in a table, one of them can be null and the other must not be null, how can I make constraint to prevent two values to be null?Somethin

I have an email and cellPhone attrib开发者_StackOverflow社区utes in a table, one of them can be null and the other must not be null, how can I make constraint to prevent two values to be null?


Something like:

CREATE TABLE mytable(   
   email varchar2(100), 
   cellphone varchar2(100),
   constraint null_check
   check (email is not null or cellphone is not null)
)
0

精彩评论

暂无评论...
验证码 换一张
取 消