NYCPHP Meetup

NYPHP.org

[nycphp-talk] Need help understanding NULL

tedd tedd at sperling.com
Sat Aug 29 19:30:12 EDT 2009


At 4:33 PM -0400 8/29/09, lists at nopersonal.info wrote:
>Daniel Convissor wrote:
>>  This is useful, in part, for statistical purposes, since the null record
>>  won't be added into averages, etc.  For example, you had three surveys
>>  filled out.  Two people actually filled in their ages (10 and 20), if you
>>  do an average when using nulls, you'll get an average age of 15.  But if
>>  you use 0's instead of nulls, the average age will incorrectly be 10.
>
>Dan, this is very helpful--thank you! The light bulb is starting to come
>on in my head now...
>
>If anyone else has practical examples, please don't hold back.
>
>Bev

Null is an odd critter. It's not an empty string, it's not '', it's 
not 0, it's NULL.

Try reading this:

http://dev.mysql.com/doc/refman/5.0/en/problems-with-null.html

Cheers,

tedd


-- 
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com



More information about the talk mailing list