Subject Re: [firebird-support] select null with "field <> 'string' "
Author Martijn Tonies
Hi Matt,


> where memo <>'DIS' or memo is null?
> or another solution
> SELECT col1, col2, col3 where memo <>'DIS'
> union
> SELECT col1, col2, col3 where memo is null

The reason for this, is that SQL knows two states for a value:
NULL and NOT NULL
or, translated to normal human language:
Unknown and Known
Empty and Filled

As you might have guessed by now -

You can't do a thing like:

Unknown value <> 'DIS'

but you need to explicitly ask for either values that are known
and different than DIS or unknown values.

MEMO <> 'DIS' OR MEMO IS NULL


With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird & MS SQL Server.
Upscene Productions
http://www.upscene.com