ABAP_DESCRIPTION An arithmetic expression> after SELECT> adds the values of the columns NUM1> and NUM2> and passes the total to the result set as SUM>. The aggregate function> count( * )> counts the rows of a group. NUM1> and NUM2> must be specified for the grouping after GROUP BY>.
The first SELECT> statement specifies NUM1> and NUM2> as individual columns after GROUP BY>. The rows are grouped by these columns. Distinct values in these columns produce separate groups, even if the total is the same.
The second SELECT> statement specifies NUM1> and NUM2> in an SQL expression after GROUP BY>. The rows are grouped by the result of the expression.