Re: Null field part of primary key
Posted in 1996
Yudong Sun wrote: > > Apparently, it's illegal for a field which is part of the primary > key to have a null value. Is this INFORMIX-specific or a widely > accepted implementation due to some logical or technical problems? > Than you. > > Yudong Well, this is a logical problem. NULL is the empty set. Ie no value. Its like trying to put a value of infinity in an index. If you look at relational math, there are several proofs and definitions involving the NULL / empty set. Let {} denote the empty set or NULL. A UNION {} = A A INTERSECT !A = {} A X {} = {} In all the discussions, I think we should remember that when you join to tables on a column which has NULL values, they will meet the criteria and give unexpected results. Also remember that NULL != 0 too! Does this help? -Mikey