If you want to include
NULL values as "not equal" then you need a
NULL safe operator. Otherwise, the
NULL, which is treated as "false" in a
You haven't specified your database, but standard SQL provides one:
where Drive_Status is distinct from 'Success'
NULL, then this returns
TRUE rather than
Not all databases support this. Some use
NULL-safe equality (that is
NULL <=> NULL evaluates to true). In these, you can use:
where not Drive_Status <=> 'Success'
And in others, you need to be more specific:
where Drive_Status <> 'Success' or Drive_Status is null