whoward69
DLL Minion
SQL tests (=, !=, >, etc) should be read as "has a value that ..." and not just as "that ...",
reads as "where Special has a value that is not equal to SPECIALUNIT_PEOPLE"
NULL is not a value, which then explains why the first version doesn't do what you would expect.
Aside: Some versions of SQL (but NOT SQLite) I've worked with permit you to write the second one as ... WHERE NOT(Special = 'SPECIALUNIT_PEOPLE'), ie, "NOT ..." reads as "everything in the table that is not ...", which fits the "IS NOT NULL" pattern
Code:
WHERE Special != 'SPECIALUNIT_PEOPLE'
reads as "where Special has a value that is not equal to SPECIALUNIT_PEOPLE"
NULL is not a value, which then explains why the first version doesn't do what you would expect.
Aside: Some versions of SQL (but NOT SQLite) I've worked with permit you to write the second one as ... WHERE NOT(Special = 'SPECIALUNIT_PEOPLE'), ie, "NOT ..." reads as "everything in the table that is not ...", which fits the "IS NOT NULL" pattern