List:General Discussion« Previous MessageNext Message »
From:Mattia Merzi Date:March 14 2009 1:18pm
Subject:Re: avoiding use of Nulls (was: The <=> operator)
View as plain text  
2009/3/13  <michael@stripped>:
>> I have a database logging weather data. When a station does not report a
>> temperature, it is set to NULL. It would be a very bad idea to set it to 0
>> as this would ruin the whole statistics.
>> NULL is a perfectly valid information in many cases.
>  I'd use -99999.9999, I'd never allow a "i don't know what it is" value
> like Null in my database.
what about a sensor that reports -99999.9999 when it is broken
or the temperature is "out of range" for it? How could you express
this information in this case? Just changing your fake-NULL value
to -88888.8888 would be something *horrible*.
I perfectly agree with Thomas, and I would expand his idea:
- sensor working: integer value between -250~+32767
- sensor now working: integer value less than -250
- sensor unavailable: NULL
I think that the advantages of this kind of architecture are easy to understand.
More generally, NULL means (in this case): I cannot write a *value* because I
have no informations, instead, -99999.9999 is a *value*!
In a previous e-mail on this thread you wrote: "NULL is garbage" or something
like this, but think: -99999.9999 is garbage.
NULL is something we all  agree, in general, it means "I don't know".
Going back to the fax-number example, you wrote (if I correctly remember) that
you would use some blanks, instead ... well, I would use a single zero
character,
and another could use some other value.... it would be a disaster!
How could you avoid this?

Greetings,

Mattia.
Thread
The <=> operatorMorten13 Mar
  • Re: The <=> operatorMichael13 Mar
    • avoiding use of Nulls (was: The <=> operator)Ray13 Mar
      • Re: avoiding use of Nulls (was: The <=> operator)michael13 Mar
        • Re: avoiding use of Nulls (was: The <=> operator)Thomas Spahni13 Mar
          • Re: avoiding use of Nulls (was: The <=> operator)michael13 Mar
            • Re: avoiding use of NullsAndy Wallace13 Mar
              • Re: avoiding use of NullsArthur Fuller14 Mar
            • Re: avoiding use of NullsPJ13 Mar
            • Re: avoiding use of Nulls (was: The <=> operator)Claudio Nanni14 Mar
              • Re: avoiding use of Nulls (was: The <=> operator)Morten14 Mar
              • Re: avoiding use of Nulls (was: The <=> operator)michael14 Mar
                • Re: avoiding use of Nulls (was: The <=> operator)Mattia Merzi15 Mar
                • Re: avoiding use of Nulls (was: The <=> operator)Claudio Nanni15 Mar
                  • Re: avoiding use of Nulls (was: The <=> operator)Don Read15 Mar
                    • W2008 Server Issues?MCUSA)16 Mar
                      • Re: W2008 Server Issues?David M. Karr16 Mar
            • Re: avoiding use of Nulls (was: The <=> operator)Mattia Merzi14 Mar
        • Re: avoiding use of Nulls (was: The <=> operator)Ray14 Mar
          • Re: avoiding use of NullsAMichel Durand14 Mar
      • Getting single results per (left) record with INNER JOINNigel Peck13 Mar
        • Re: Getting single results per (left) record with INNER JOINNigel Peck13 Mar
          • Re: Getting single results per (left) record with INNER JOINArthur Fuller14 Mar
            • Re: Getting single results per (left) record with INNER JOINNigel Peck14 Mar
              • Re: Getting single results per (left) record with INNER JOINJohan De Meersman15 Mar
                • Re: Getting single results per (left) record with INNER JOINNigel Peck15 Mar
        • Re: Getting single results per (left) record with INNER JOINJoerg Bruehe16 Mar