I have a table:
CREATE TABLE ProjectCreationTasks
(
Id text NOT NULL PRIMARY KEY,
ProjectName text,
ProjectCode text,
DenialReason text
);
An administrator can approve or deny a project creation request. To approve, the admin sets both a ProjectName and ProjectCode; to deny, the admin sets a DenialReason.
How can I add a constraint such that:
Name,Code,Reasoncan all be null simultaneouslyIf both
NameandCodehas a value thenReasonmust be nullIf
Reasonhas a value, then bothNameandCodemust be null
Thank you in advance.