Order of Evaluation - Analytics Database - Teradata Vantage

SQL Functions, Expressions, and Predicates

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-01-12
dita:mapPath
obm1628111499646.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
kby1472250656485
lifecycle
latest
Product Category
Teradata Vantageā„¢

The following table lists the precedence of operations in arithmetic expressions.

Precedence Operation
Highest + operand   (unary plus)

- operand    (unary minus)

Intermediate operand ** operand     (exponentiation)
operand * operand     (multiplication)

operand / operand     (division)

operand MOD operand     (modulo operator)

operand + operand    (addition)

operand - operand    (subtraction)

In general, the order of evaluation is:

  1. Operations enclosed in parentheses are performed first.
  2. When no parentheses are present, operations are performed in order of precedence.
  3. Operators of the same precedence are evaluated from left to right.

The Optimizer may reorder evaluations based on associative and commutative properties of the operations involved.