Here is an example table with three columns (ID, UNIQUE_VALUE, UNIQUE_GROUP_ID)
I want below valid entries:
(1, NULL, NULL) (2, NULL, NULL)
or
(3, NULL, 7) (4, 123, 7)
or ( Note: this condition is not allowed in unique index and unique constraint )
(5, NULL, 7) (6, NULL, 7)
and they cannot be allowed:
(7, 123, 7) (8, 123, 7)
I created a unique index for the last two columns, but only the first 2 examples can be resolved.
Can db be allowed to verify the uniqueness of these two columns only when both values ββare non-zero?
sql database oracle indexing
Eric
source share