SELECT Section (Query Description)

The query description section consists of several interrelated clauses:

SELECT [ALLOWED] [DISTINCT] [TOP <Quantity>]
     <Selection field list>
[INTO <Temporary Table Name>]
[FROM <Source List>]
[INDEX BY <Index Field List>]
[WHERE <Filter Criterion>]
[GROUP BY <Grouping Fields>]
[HAVING <Filter Criterion>]
[FOR UPDATE [[OF]<Highest Level Tables List>]]

This is the only required section in the query text, and in many cases this is all you need. The section describes query data sources, selection fields, groups, etc. This section is also described by a set of rules.

As noted before, a query description section should be included in the query text, defining the following:

  • fields to be included in the query result;
  • query data sources – source tables;
  • conditions affecting data selection in the query;
  • the order for groups of query results.

1C:Enterprise Developer's Community