Subject | Re: Re: [firebird-support] case when, in, null semantics? |
---|---|
Author | Pavel Menshchikov |
Post date | 2005-03-14T17:56:03Z |
Kjell,
KR> no matter what. In my case the when-predicate evaluates to UNKNOWN, so
KR> the then-value is not used. It proceeds to the else-value and picks
KR> that. All in accordance with the SQL standard.
KR> Right?
Are you sure that the condition is evaluated to UNKNOWN? I think it is
evaluated to false: 'a'<>'b' and 'a'<>null.
HTH
--
Best regards,
Pavel Menshchikov
http://www.ls-software.com
>> case when 'a' in ('b', nullif(1, 1)) then 1 else 0 endKR> Ah, I see! Case always returns one of the then-values or the else-value,
>>
>> I would expect this to return null, because the null item in the "in"
>> list could possibly be an 'a', which would return 1. But it actually
>> returns 0.
KR> no matter what. In my case the when-predicate evaluates to UNKNOWN, so
KR> the then-value is not used. It proceeds to the else-value and picks
KR> that. All in accordance with the SQL standard.
KR> Right?
Are you sure that the condition is evaluated to UNKNOWN? I think it is
evaluated to false: 'a'<>'b' and 'a'<>null.
HTH
--
Best regards,
Pavel Menshchikov
http://www.ls-software.com