Use of Expressions in the Query Language

Expressions can be used in many constructs of the query language. Query language expressions are described as follows:

<Expression>
      |
  <Field dereferencing> | <Aggregate function> | <Query language function> | <Selection operation> |
<Type cast>[.<Field dereferencing>] | <Value> |
<Expression> <Binary operation> <Expression> | <Unary operation> <Expression> | ( <Expression> )

In the simplest case, an expression is a reference to a field of the source table that serves as a query data source. A reference can be defined with a table that contains this field or without defining the table itself. For rules of table fields designation, see Field Dereferencing topic.

Expressions in the selection field list and in the HAVING, TOTALS, ORDER BY clauses can be represented by aggregate functions.

An expression can be a function of the query language. The selection operations and value type conversion operations can be used.

The expressions can directly define the values of logical, numeric, string and other constants; the query parameters values can be used as well. Binary and unary operations can be applied to the values of appropriate types within expressions.

Limitations:
Maximum length of operation series of the same priority should not exceed 2048, for example: v1 + v2 + v3 + ... + v2048.
Maximum number of nested operations of different priorities (including parentheses) should not exceed 2048.

1C:Enterprise Developer's Community