1, the field can be null, when a null, there is no requirement
2, when the field is a non-empty, required field must not empty b
Add constraint statement:
alter table shpfront add constraint
Check (
Shop_id is null
Or (
Shop_id is not null and duty_id is not null
)
);
An error
ORA - 02438: column check constraints can't quote the other columns
CodePudding user response:
The alter table shpfront add constraint aaa
Check (
Shop_id is null
Or (
Shop_id is not null and duty_id is not null
)
);
CodePudding user response:
Use the insert row trigger to solve this kind of complex requirements,