Operators are generally used to connect operands or parameters and return a result. In terms of syntax, operators can appear before, after, or between operands.
Operators are usually represented by special characters or keywords. For example, the division operator is represented by a slash (/).
Common operators can be divided into unary and binary operators:
Unary operators
Unary operators operate on a single operand. The common format of a unary operator is as follows:
operator operandBinary operators
Binary operators operate on two operands. The common format of a binary operator 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 focuses on 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: