|Subject||Re: [firebird-support] Why NULL <> NULL ?|
>Not illogical at all.
>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.
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
Database Workbench - development tool for Firebird and more!
Database development questions? Check the forum!