Operators are generally used to connect operands or parameters and return results. From a syntactic perspective, operators can appear before, after, or between operands.
Operators are typically represented by special characters or keywords. For example, the division operator is represented by the slash (/).
Common operators can be further divided into unary and binary operators:
Unary operators
Unary operators operate on a single operand. The common format for unary operators is as follows:
Operator operandBinary operators
Binary operators operate on two operands. The common format for binary operators is as follows:
Operand1 operator Operand2Note
- Other operators with special formats can accept more than two operands.
- If an operator is provided with a NULL operand, the result is always NULL. The only exception is the concatenation operator (||).
This chapter primarily covers non-logical (non-boolean) operators, which cannot be used as WHERE or HAVING conditions in queries or subqueries. OceanBase Database currently supports the following operators: