Subject Re: AW: [firebird-support] NOT in Firebird
Author Mark Rotteveel
On Thu, 04 Jul 2013 14:40:30 +0200, Paul Vinkenoog <paul@...>
wrote:
> Olaf wrote:
>
>> great, exactly what I was looking for. Only 1 and 0 is possible.
>
> Then you can also do
>
> Var2 = 1 - Var1
>
> The outcome is the same, but perhaps this is more obvious than bitwise
> XORing with 1. And it might execute a wee little faster.

Totally forgot about that option ;)

Yet another way is to use DECODE
(http://www.firebirdsql.org/file/documentation/reference_manuals/reference_material/html/langrefupd25-intfunc-decode.html
):

for example: DECODE(var1, 0, 1, 1, 0)

Mark