SQL/MP Reference Manual
HP NonStop SQL/MP Reference Manual—523352-013
E-23
Considerations—Expressions
start-field and end-field specify the range of DATETIME fields for the
operand, as described under DATETIME Data Type on page D-15. If the range
includes fields not in value of the column, literal, function, host variable, or
parameter, SQL extends the value to include the new fields by using the same
initial values as for an extension using the EXTEND function.
If the range omits fields not in the original value, SQL truncates those fields.
interval-operand
is a column name (possibly qualified by a correlation name), a literal, a function
invocation, a host variable, a parameter name, or an expression that evaluates to
an INTERVAL value.
start-field, digits, and end-field specify the range of INTERVAL fields
for the operand and the number of digits in the starting field, as described under
INTERVAL Data Type on page I-19.
arithmetic-operator
specifies one of these arithmetic operations:
Considerations—Expressions
Order of evaluation
The order of evaluation of an expression is:
1. Expressions within parentheses
2. Unary operators
3. Exponentiation
4. Multiplication and division
5. Addition and subtraction
Operators at the same level are evaluated from left to right for all operators
except exponentiation. Exponentiation operators at the same level are
evaluated from right to left. For example, X + Y + Z is evaluated as (X + Y) + Z,
whereas X ** Y ** Z is evaluated as X ** (Y ** Z).
An expression with a numeric operator evaluates to null if any of the operands is
null.
** Exponentiation
* Multiplication
/ Division
+ Addition
- Subtraction