Re: Nulls vs Blanks?
Posted in 1996
In article <4depoe$m9b@news.informix.com>, Robert Zook <lalaith@inf.net> wrote: >Keep in mind two things about nulls: you cannot put a null in a serial column, true >and if you run an aggregate function (AVG,SUM,MIN,or MAX) on a column with >nulls the function will return a null. Not generally true -- only if ALL qualified rows have NULL in that column will those aggregates return NULL -- otherwise, the NULLs are *ignored*. >Avoid using nulls then in these three cases: no nulls in a column defined as >serial (the software will not allow it), no nulls in a primary key column, and >no nulls in a column you plan on using in calculations. Another thing to keep in mind: don't build a single-column index on a column that has lots of NULLs. Since NULLs are all represented with the same value, excessive duplication will result, and performance of queries utilizing that index will suffer. -- Alan Denney aland@informix.com "It is unimaginable that the Chinese would kill such a goose (as Hong Kong's independent commerce). Yet we wouldn't need the metaphor of golden eggs and geese if history wasn't full of dead geese." -- Christopher Patten, Governor of Hong Kong