In SQL, a join is the combination of two data sources into one result set, consisting of columns of both data sources. The rows are determined by the join type and the join condition, also called the ON-condition.
ABAP CDS and ABAP SQL support the same join types, among them INNER JOIN, LEFT OUTER JOIN, and RIGHT OUTER join. For other supported join types, refer to the ABAP keyword documentation.
The syntax for joins is very similar in ABAP SQL and ABAP CDS, though not identical. Let's look at an example.
In ABAP CDS, the period sign (.) is used as separator between a field name and the data source name or, if an alias is defined for this data source, the data source alias name. In this ABAP SQL follows the SQL standard. In ABAP SQL, the tilde sign (~) is used for this purpose. The reason is, that in ABAP, the period sign is already used as statement delimiter.
The other syntax difference concerns the use of fields in the field list or element list. In CDS view entities, the data source name is mandatory for all fields. In ABAP SQL, the source name is only required when there are fields of the same name in different data sources. In the example, this is the case for field carrier_id because a field of that name exists in both data sources.