Reputation: 9858
I have an email and cellPhone attributes 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?
Upvotes: 3
Views: 148
Reputation: 403551
Something like:
CREATE TABLE mytable(
email varchar2(100),
cellphone varchar2(100),
constraint null_check
check (email is not null or cellphone is not null)
)
Upvotes: 10