All Products
Search
Document Center

Column expressions

Last Updated: Jun 18, 2021

Column expressions are a limited form of expr. A column expression is named column_expression in the syntax of other expressions in this chapter. Column expressions can be simple expressions, compound expressions, function expressions, or expression lists. Column expressions can contain only the following forms of expressions:

  • Columns in the table that is created, changed, or indexed.

  • Constants (strings or numbers).

  • Deterministic functions, such as SQL built-in functions or user defined functions.

Other forms of expressions except the preceding forms of expressions are invalid column expressions. In addition, column expressions do not support compound expressions and aggregate functions that use the PRIOR keywords.

You can use column expressions to achieve the following purposes:

  • Create a function-based index.

  • Explicitly or implicitly define a virtual column. When you define a virtual column, column_expression applies to only the column of the table that has been defined in a previous statement.

The components of a column expression must be deterministic. This indicates that the same input values must return the same output values.