I am trying to implement a check constraint (since Conditional Foreign keys are not possible).
In my table, column REFDCD should either be blank or should be found in the Primary Key (DLR_CODE) of the same table.
I tried :
alter table dist_mas add check (refdcd in (select distinct dlr_code from dist_mas))
But subqueries are not allowed in Check constraints.
Can someone guide me?
Thanks
Mohan
MohanSQL