An expression is a generalized concept. It usually has several input parameters and returns one result. The input parameters may be constants, a single row of data, or multiple rows of data. Expressions can be combined. The input of one expression can be the output of another expression.
Expressions can be divided into the following types based on the sources and forms of expressions:
- Column reference
- Constant
- Operator
- Function
Example:
SELECT ABS(a + 1)
FROM t1
WHERE a > 0;
- a is an expression that references values in a column.
- 0 and 1 are constants.
>> and+are operators, with 0, 1, and a used as the input.
ABSis a function that uses the+expression as the input.