ADD CONSTRAINT CK_SPLFEATURES CHECK ((special_features ='Trailers') OR(special_features ='Commentaries') OR(special_features ='Deleted Scenes') OR(special_features ='Behind the Scenes'));
检查违反的约束
我得到了这个错误,它适用于其他东西但不是这个
答案 0 :(得分:1)
我假设您有一些违反约束的数据。你可以通过否定表达来找出答案:
select ... from T
where not (
(special_features ='Trailers') OR(special_features ='Commentaries')
OR(special_features ='Deleted Scenes') OR(special_features ='Behind the Scenes')
);