User Tools

Site Tools


conditional_check_constraint

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

conditional_check_constraint [2019/01/30 15:39] (current)
mihael created
Line 1: Line 1:
 +====== Conditional Check Constraint ======
  
 +<sxh sql>
 +ALTER TABLE table1 ADD CONSTRAINT table1_conditional
 +CHECK(
 +  (field1 = 1 AND field3 IN ('​MIHAEL',​ '​MICHAEL'​)) OR
 +  (field1 = 2 AND field3 IN ('​MIHAIL',​ '​MIKAEL'​))
 +);
 +</​sxh>​
 +
 +{{tag>​sql}}
conditional_check_constraint.txt ยท Last modified: 2019/01/30 15:39 by mihael