Subject Re: [firebird-support] select null with "field <> 'string' "
Author Helen Borrie
At 12:08 PM 9/10/2003 +0000, you wrote:
>Hello all,
>I'm trying to do a select which should pick up all records where a memo
>field is not equal to the value 'DIS'. The problem I am finding when I
>use "where memo <> 'DIS'" is that a record with memo=<null> is not
>returned! This is a problem since null is the default value for this
>field and I need to return those records.
>Why is null apparently not regarded as <> 'DIS' and what can I do about
>it?
>I'm on linux with a version of firebird around 1.0.0.

Null is a state not a value!! (Tattoo this on the back of your hands).

Use
"where memo is null or memo <> 'DIS' "
STATE test non-equivalence test compares values

NB. "memo = null" and "memo <> null" are not valid predicates.

H.