User Tools

Site Tools


conditional_check_constraint

Conditional Check Constraint

ALTER TABLE table1 ADD CONSTRAINT table1_conditional
CHECK(
  (field1 = 1 AND field3 IN ('MIHAEL', 'MICHAEL')) OR
  (field1 = 2 AND field3 IN ('MIHAIL', 'MIKAEL'))
);

conditional_check_constraint.txt · Last modified: 2019/01/30 15:39 by mihael