OQL Operators

Last modified: May 29, 2024

The following operators can be used in OQL expressions:

OperatorDescriptionExample
+Addition6 + 4 returns 10.
-Subtraction6 - 4 returns 2.
*Multiplication6 * 4 returns 24.
:Division8 : 4 returns 2.
%Modulo8 % 3 returns 2.
=Equal toPrice = 9.80 returns true if price is 9.80, false if price is 9.90.
!=Not equal toPrice != 9.80 returns true if price is 9.90, false if price is 9.80.
<Less thanPrice < 9.80 returns true if price is 9.70, false if price is 9.80.
<=Less than or equal toPrice <= 9.80 returns true if price is 9.80, false if price is 9.90.
>Greater thanPrice > 9.80 returns true if price is 9.90, false if price is 9.80.
>=Greater than or equal toPrice >= 9.80 returns true if price is 9.80, false if price is 9.70.
LIKEMatches the pattern after the operator. The wildcard character '%' can be used to define any string of zero or more characters. In order to search for special characters like %, _, and \, they should be escaped with the \ escape character.City LIKE '%dun' returns all the cities with names that end with 'dun', like 'dun' and 'Losdun'.
Symbol LIKE '%\%' returns all the symbols that end with the % special character.
INMatches any value in a subquery or a list of expression values.City IN (SELECT Name FROM City WHERE Country = 'Gelre') City IN ('Losdun', 'Die Haghe', 'Haagambacht')
EXISTSTest for the existance of any rows when executing the subquery.EXISTS (SELECT ID FROM City WHERE City = 'Losdun') Returns true if object exists
NOTReverses the value of the expression following this keyword.NOT City = 'Rotterdam' returns all objects not in Rotterdam.
CASEEvaluates one or more conditions and returns a possible expression.See OQL Case Expressions.
ORReturns true if one or both expressions around this operator return true.price = 9.80 OR price = 9.70 returns true if price is 9.80, false if price is 9.60.
ANDReturns true if expressions on both sides return true.price = 9.80 AND amount = 1 returns true if price is 9.80 and amount is 1, false if price is 9.70 and amount is 1, false if price is 9.80 and amount is 2.