Path: utzoo!attcan!uunet!wuarchive!zaphod.mps.ohio-state.edu!sdd.hp.com!elroy.jpl.nasa.gov!lll-winken!cert!netnews.upenn.edu!grad2.cis.upenn.edu!aaron From: aaron@grad2.cis.upenn.edu (Aaron Watters) Newsgroups: comp.databases Subject: Re: Outerjoin implementation? Message-ID: <30354@netnews.upenn.edu> Date: 1 Oct 90 12:36:10 GMT References: <1990Sep20.161204.13014@tfic.bc.ca> <11034@sybase.sybase.com> <1990Sep28.231042.5117@tfic.bc.ca> Sender: news@netnews.upenn.edu Reply-To: aaron@grad2.cis.upenn.edu.UUCP (Aaron Watters) Distribution: comp Organization: University of Pennsylvania Lines: 29 [Chris Hermanson argues that nulls are bad...] In article <1990Sep28.231042.5117@tfic.bc.ca> clh@tacitus.UUCP (Chris Hermansen) writes: >For example, a field named widget_count is never (realistically) going to >have a value less than zero, so if you need an "undefined" value for it, use >-1, or -99999999, or some other nice number. Similarly, a widget_status >value of "unknown" tells me more than NULL - with NULL, I can't decide whether >the status is genuinely unknown, or whether the system just doesn't know it. While admitting that this last point may be too deep for me, let's once again consider an example. What if we have two stockrooms each of which contains a number of widgets. Room A has 10 widgets and noone knows how many widgets are in room B. The total number of widgets in both rooms is therefore either 9 or -99999989, of course. That was a joke, I presume you realize, but how does one get around this summation anomaly? It seems you need to have something analogous to the following: If all widgetcounts are positive then X=sum(widgetcount) otherwise X=-1. Furthermore, if you have a large number of conventions like this more complex queries (especially if you have complex views) can become quite baroque. If you use actual null values, however, the queries are still somewhat baroque, but easier to understand. A personal interest of mine is the question of whether the programmer can ignore the possibility of nulls entirely and have the system handle them in a logically uniform way -- which, I argue is not currently done automatically. -aaron.