An operator joins individual data items such as operands or parameters and returns a result. Syntactically, an operator can appear before an operand, after an operand, or between two operands.
Operators are represented by special characters or keywords. For example, the division operator is represented by a forward slash (/).
General operators can be categorized into unary and binary operators.
Unary operators
A unary operator operates on only one operand. A unary operator typically appears in the following format:
operator operandBinary operators
As the name suggests, a binary operator operates on two operands. A binary operator typically appears in the following format:
operand1 operator operand2Note
- Other operators with special formats can accept more than two operands.
- If an operator is given a NULL operand, the result is always NULL. The only operator that does not follow this rule is the concatenation operator (||).
This chapter describes non-logical (non-Boolean) operators that cannot be used alone as the WHERE or HAVING condition in queries or subqueries. OceanBase Database supports the following operators: