Operator Precedence

An operator is a symbol or keyword that can be in an SQL expression. Most SQL operators are restricted in the data types of their operands and returned values. Some operators only support operands of built-in data types; others can support built-in and extended data types as operands.

The following table shows the precedence of the operators thatHCL OneDB™ supports, in descending (highest to lowest) order of precedence. Operators with the same precedence are listed in the same row.
Operator Precedence Example in Expression
. (membership) [ ] (substring) customer.phone [1, 3]
UNITS x UNITS DAY
+ - (unary) - y
:: (cast) NULL::TEXT
* / x / y
+ - (binary) x -y
|| (concatenation) customer.fname || customer.lname
ANY ALL SOME orders.ship_date > SOME (SELECT paid_date FROM orders)
NOT NOT y
< <= = > >= != <> x >= y
IN BETWEEN ... AND LIKE MATCHES customer.fname MATCHES y
AND x AND y
OR x OR y

See the HCL OneDB Guide to SQL: Syntax for the syntax and semantics of these SQL operators.