Subject | Re: [firebird-support] How can I correctly write this WHERE |
---|---|
Author | Mark Rotteveel |
Post date | 2018-06-19T15:12:37Z |
On 19-6-2018 13:54, Svein Erling Tysvær setysvar@...
[firebird-support] wrote:
earlier it won't work, but with Firebird 3 using a comparison after the
THEN in a CASE will work, as a comparison is an expression with a
boolean result, which leads to the CASE having a boolean result (which
is not supported in earlier versions), which means it can be used as a
condition in the WHERE-clause
Mark
--
Mark Rotteveel
[firebird-support] wrote:
>Whether it works depends on the Firebird version. With Firebird 2.5 and
>
> Hi Bhavbhuti!
>
> According to https://firebirdsql.org/refdocs/langrefupd15-case.html
>
> this is how case is written:
>
> CASE <expression>
> WHEN <exp1> THEN result1
> WHEN <exp2> THEN result2
> ...
> [ELSE defaultresult]
> END
> and definitely not
>
> CASE <expression>
> WHEN <exp1> THEN comparison
> WHEN <exp2> THEN comparison2
> ...
> [ELSE defaultcomparison]
> END
earlier it won't work, but with Firebird 3 using a comparison after the
THEN in a CASE will work, as a comparison is an expression with a
boolean result, which leads to the CASE having a boolean result (which
is not supported in earlier versions), which means it can be used as a
condition in the WHERE-clause
Mark
--
Mark Rotteveel