Skip to content

ABAP Keyword Documentation →  ABAP - Quick Reference 

sql_agg - Quick reference

Reference

Other versions: 7.31 | 7.40 | 7.54

Syntax


... { AVG( [DISTINCT] col [AS dtype] ) 
    | MAX( [DISTINCT] sql_exp )
    | MIN( [DISTINCT] sql_exp )
    | SUM( [DISTINCT] sql_exp )
    | STRING_AGG( sql_exp[,sep] [ORDER BY col1[ASCENDING|DESCENDING], ...]
    | COUNT( [DISTINCT] sql_exp )
    | COUNT( * )
    | COUNT(*) } ...

Effect

Aggregate expressions in queries.

Additions

  • AVG( [DISTINCT] col  [AS dtype] )
    Average value of the values in the column col with an optional target data type dtype specified.
  • MAX( [DISTINCT] col|sql_exp )
    Maximum value of the results of the SQL expression sql_exp.
  • MIN( [DISTINCT] col|sql_exp )
    Minimum value of the results of the SQL expression sql_exp.
  • AVG( [DISTINCT] col )
    Average value of the results of the SQL expression sql_exp.
  • SUM( [DISTINCT] col|sql_exp )
    Total of the results of the SQL expression sql_exp.
  • STRING_AGG( sql_exp[,sep] [ORDER BY col1[ASCENDING|DESCENDING], ...] )
    Chaining of the results of the SQL expression sql_exp.
  • COUNT( [DISTINCT] col|sql_exp )
    Number of the results of the SQL expression sql_exp.
  • COUNT( * ), COUNT(*)
    Number of rows in the results set.