Subject nulls in unique constraints
Author Adam
Hello Group,

I have a set of fields that is considered to be a candidate key.
Because I do not like having a composite primary key (it makes foreign
keys a pain to implement), I have created a surrogate field for the
primary key. I would like to declare a unique constraint across the
candidate key fields (there are 3 of them).

One of the three fields can be null, the other two can not be null.
Will Firebird accept the unique constraint:

TableA
(
ID integer not null,
A integer not null,
B integer not null,
C integer
)

If a unique constraint is able to be added across (A,B,C)

Would

ID A B C
1 1 1 null
2 1 1 null

be considered unique?

From a business perspective, it makes sense for C to be left null, but
if this is a problem, I will substitute it with 0 or something.

Adam