CREATE TABLE A (
one INT CHECK (one > 0),
two INT CHECK (two > 0),
three INT CHECK (three > 0),
four INT CONSTRAINT ok CHECK (
four < one + two + three),
PRIMARY KEY (one, two)
);
I have the following table above. Fields one, two, three
must be positive, and field four
must be less than the sum of each of these fields.
How come when I insert insert into A values (1, 2, 3, null);
, the query does not fail?
It doesn't make sense for null < 1 + 2 + 3
, but it still lets me enter it?