Table of Contents |
---|
The SELECT clause consists of a list of expressions. Each of these expressions is of a particular data type. The list very often consists of just one expression and this expression contains references to objects and relations.
eSQL Return Tables
An eSQL instruction always returns a table. The SELECT clause determines how many columns the table has and what types the columns are. All types of the type system can appear – both simple types and class types. The result tables of most current examples consist of a column that has a class type as the column type. This example therefore delivers a single-column table with the complex column type person.
...
Code Block | ||
---|---|---|
| ||
SELECT [c1], [r].[personincharge], [c2] FROM [contract] AS [c1] JOIN [contract2contract] AS [r] JOIN [contract] AS [c2] |
Asterisk
The asterisk symbol (*) can be used in the SELECT clause. This means that everything in the FROM clause is identified. It is just a resource for being able to formulate eSQL queries more easily.
...
eSQL | Number of relations contained |
---|---|
|
|
|
|
|
|
All / Distinct
The additions DISTINCT or ALL can follow the keyword SELECT.
...
Relations are the same if the first ID and the second ID are the same and they are of the same type. Here it must be noted that there can be multiple relations of different types between two objects.
Subselects
In the SELECT clause, subselects can also appear as an expression. However, a subselect must return a table with a column and one row at most for this. Often the property of having one row at most is ensured by an aggregate function.
...
There is only one subselect in each of the examples but there can be any number of subselects in a SELECT clause.
Literals
As well as references to class types, their elements or subselects can also contain literals in the SELECT clause.
...