NYCPHP Meetup

NYPHP.org

[nycphp-talk] Need help understanding NULL

Michael Southwell michael.southwell at nyphp.com
Sat Aug 29 22:17:56 EDT 2009


John Campbell wrote:
> In sql, every comparison to NULL, yields another NULL.
> That is why 'SELECT * WHERE foo = NULL' doesn't do what you might
> expect.  In fact that query is guaranteed to always return zero rows.

which is why the correct syntax for such a select would have to be 
'SELECT * [FROM table] WHERE foo IS NULL' rather than '= NULL'


-- 
=================
Michael Southwell
Vice President, Education
NYPHP TRAINING:  http://nyphp.com/Training/Indepth



More information about the talk mailing list