Subject Re: [firebird-support] Why NULL <> NULL ?
Author Martijn Tonies

>In trigger I have:
>if (field1 = field1) then ...
>when field1 = null, field2 = null
>(field1 = field2) = false :(
>so I have to make an exception for null case, that is very ilogical.

Not illogical at all.

NULL it a state, not a value.

A column can have two states: NULL or NOT NULL

A column can have many values.

This is why in order to check the column state, you use
"IS NULL" or "IS NOT NULL", while when comparing
column values, you use "= <some other value>".

If you want to compare for the state as well, you have
to modify your code OR use the COALESCE function

Martijn Tonies
Database Workbench - development tool for Firebird and more!
Upscene Productions
My thoughts:
Database development questions? Check the forum!