Operators are generally used to connect operands or parameters and return results. 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 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 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:
