Expressions are composed of a combination of data values and operators.
Data values may be specified as constants (literal values), or
retrieved from a database. Database values are specified by using the
name of the data column. The name must be specified exactly as
recorded in the DBMS. Database columns names are casesensitive, and
AREA
will refer to a different column than
Area
.
Important  

Many simple DBMS store column names in upper case, but unfortunately some applications (e.g. ArcView 3.2) display column names with a different capitalization than is actually stored in the database. Care must be taken to identify columns correctly. 
Operators are applied to data values, or combine several data values (e.g. "1 + 1"). When an expression contains multiple operators the operators are applied in sequence according to a standard set of rules of operator precedence. Table 2 lists the available operators. These are listed in order of precedence (for example, in the expression "1 + 2 * 3" the multiplication will occur before the addition). Where several identical operators occur in a row they are evaluated from left to right. Parentheses may be used to explicitly control the order of evaluation (e.g. "(1 + 2) * 3").
Some of the operators have several aliases. For example the relational 'less than' operator can be represented by the symbols 'lt' or '<'. There is no difference between these two usages. Capitalization does not matter in operator symbols ('AND' is the same as 'And').
An expression may be composed of several subexpressions, each separated by the semicolon (;) character. The subexpressions will be evaluated in sequence, and the returned value of the expression will be the value of the final subexpression. Values produced by the initial subexpressions will be discarded, however these subexpressions may have side effects (e.g. the setVar() function) that influence subsequent subexpressions.
Operator  Syntax  Description  Result 

Logical 'or' 

The logical 'or' operator combines two boolean operands. The results is 'true' if either operand evaluates to 'true'. 
<bool> 
Logical 'and' 

The logical 'and' operator combines two boolean operands. The results is 'true' only if both operands evaluate to 'true'. 
<bool> 
Binary 'or' 

The binary 'or' operator combines the bit fields in two integers using an 'or' operation. The result is always an integer. 
<int> 
Binary 'xor' 

The binary 'exclusive or' operator combines the bit fields in two integers using an 'xor' operation. The result is always an integer. 
<int> 
Binary 'and' 

The binary 'and' operator combines the bit fields in two integers using an 'and' operation. The result is always an integer. 
<int> 
Equality 

The equality operator performs a test to see if the two operands are equal. The result is always a boolean. 
<bool> 
Inequality 

The inequality operator performs a test to see if the two operands are not equal. The result is always a boolean. 
<bool> 
in 

The right operand is assumed to be a commaseparated list of string values (e.g. 'A,B,C'). The 'in' operator will test to see if the left operand is equal to any of the values in the right hand list. If an exact match is found the result will be true, otherwise false. 
<bool> 
Relational 
where op can be:

Compare two values using a relational operator. The values may be both strings (in which case a lexicographical comparison is made), both integers (an integer comparison is made), or a combination of integers and numbers (automatic type promotion occurs and the numbers are compared). 
<bool> 
Bit shift 

These operators implement bit operations for logical shift right '>>>', signed shift right '>>' and shift left '<<'. The value on the left is the bit field to be shifted, and the value on the right is the amount of the shift. These operators always return an integer bitfield. 
<int> 
Concatenation 

The string values of the two operands are concatenated together. If one of the operands is not a string value, it will undergo automatic promotion to a string. 
<string> 
Summation 

Add or subtract two values. If both values are integers the result will be an integer. If one of both of the values is a number the result will be a number. 
<int> or <number> 
Product 

Multiple, divide or modulo two values. If both values are integers the result will be an integer. If one of both of the values is a number the result will be a number. 
<int> or <number> 
Negation 

Returns the negative of the original value. 
<int> or <number> 
Logical Not 

Performs a logical not operation on a boolean value. If the operand is true, the result will be false. If the operand is false, the result will be true. 
<bool> 
Bitwise Compliment 

Performs a bitwise complement operation. The result will always be an integer. 
<integer> 