Ansicht
Dokumentation

ABENSELECT_GROUPING_SETS_ABEXA - SELECT GROUPING SETS ABEXA

ABENSELECT_GROUPING_SETS_ABEXA - SELECT GROUPING SETS ABEXA

CPI1466 during Backup   General Material Data  
This documentation is copyright by SAP AG.
SAP E-Book

SELECT, Grouping Sets

This example demonstrates the GROUP BY addition GROUPING SETS of the statement SELECT.

Source Code

Execute

Description

For Lufthansa flights, this example calculates the sum of the maximum available seats depending on the plane type (column planetype) and the connection (column connid). Two grouping sets are defined, which contain either the plane type or the connection.

The example shows that SELECT statements that use UNION ALL or GROUPING SETS are equivalent. The first query defines the grouping sets ( carrid, planetype ) and ( carrid, connid ) with a GROUP BY clause. The second query, on the other hand, specifies the same grouping sets using two GROUP BY clauses and merges them using UNION ALL.






General Material Data   CPI1466 during Backup  
This documentation is copyright by SAP AG.

Length: 1316 Date: 20240426 Time: 060437     sap01-206 ( 31 ms )