SAP CDS SELECT CLAUSES V2
Get Example source ABAP code based on a different SAP table
ABAP_CDS_DDL - CDS View Entity, SELECT>, clauses> ABAP_SYNTAX ... $[WHERE cds_cond>$]
$[GROUP BY field1, field2, ...>$]
$[HAVING cds_cond>$]
$[EXCEPT SELECT ...$]>>
$[INTERSECT SELECT ...$]>>
$[UNION $[ALL$] SELECT ...$]>> ...>
What does it do?
The optional clauses of the SELECT > statement> of a CDS view entity> have the following semantics:
The WHERE> clause> restricts the rows in the result set when the CDS view entity is accessed.
The GROUP BY> clause> groups rows in the result set when the CDS view entity is accessed. It is applied after rows are selected using the WHERE > clause.
The HAVING> clause> restricts the result set further after a GROUP BY> clause. Aggregate expressions> are possible after HAVING>.
EXCEPT>>, INTERSECT>>, and UNION>> are set operators>>. They can be used to merge the result sets of multiple SELECT> statements into a single result set.
Latest notes:
CDS view entities do not support ORDER BY> for the following reasons:
Historic reason: Some database platforms that support ABAP CDS do not support ORDER BY> in views.
Undefined behavior may occur when ORDER BY> is used in multiple views within a view stack.
Undefined behavior may occur in complex views that, for example, join multiple data sources and use an ORDER BY > clause.
NON_V5_HINTS
ABAP_HINT_END