Expression Types

In SQL Query Builder, you can use build expressions of these types when creating SQL statements.

Table 1. Expression types
Type Description
Function A function returns a value. Functions types include column functions, scalar functions, row functions, or table functions.

  • The argument of a column function is a collection of like values (a column). This function can return a NULL value.
  • The argument(s) of a scalar function are individual scalar values, which can be of different types. This function can return a NULL value.
  • The argument of a row function is a structured type. The function returns a row of built-in data types and can only be specified as a transform function for a structured type.
  • The argument(s) of a table function are individual scalar values, which can be of different types. The function returns a table, and can be specified only within the FROM clause of a SELECT statement.
CASE CASE expressions allow an expression to be selected based on the evaluation of one or more conditions. A CASE expression contains one or more when clauses of either Search or Simple type.
  • A Search CASE expression contains a condition that is evaluated, such as i<8.
  • A Simple CASE expression determines if the when clause evaluates to true; otherwise, the else clause determines the value of the case-expression.
CAST A CAST function converts instances of a datatype to instances of a different datatype.
Constant A constant specifies a value: a string or a number.
  • Numeric constants can be an integer, floating-point, or decimal.
  • A string constant can be a character string, hexadecimal, or a host variable name. A colon precedes the host variable name, for example, :var. The host variable becomes a value when the statement is executed.
Subquery A subquery is a SELECT, WITH, or FULLSELECT statement nested within another SQL statement. The expression value is the result of the subquery.
Build up expressions by operators You can build an expression by applying operators to columns or expressions such as x+y where x is a column and y is an expression.
Related tasks
Building Expressions