ECSql Operators

Bitwise operator

Operator Description Example
& Bitwise AND (4&2 ) output 0
~ Bitwise NOT urinary ( ~1 ) output -2 or 0xfffffffffffffffe
| Bitwise OR (3|4 ) output 7
<< Bitwise shift left (1<<2) output 4
>> Bitwise shift right (4>>1) output 2

Arithmetic operator

Operator Description Example
+ Add (1 + 1) output 2
- Subtract (2 - 1) output 1
* Multiply (2 * 2) output 4
/ Divide (4 / 2) output 2
% Modulo (4 % 2) output 0

String operator

Operator Description Example
|| Concatenate 'Hello'|| ',' || 'World' output Hello,World

Boolean operator

Operator Description Example
= Equal (1 = 3) output FALSE
> Greater than (1 > 3) output FALSE
< Less than (1 < 3) output TRUE
>= Greater or equal to (3 >= 3) output TRUE
<= Less or equal to (3 <= 5) output TRUE
<> Not equal (1 <> 3) output TRUE
!= Not equal (1 != 3) output TRUE
OR OR op (1=2 OR 1=1) output TRUE
AND AND op (1=1 AND 1=1) output TRUE
NOT NOT unary op NOT (1=1) output FALSE

ECSql Syntax

Last Updated: 15 May, 2024