SQL Reference
Sorted Aggregate Functions
aggregate functions compute a single result from a group of rows these aggregate functions support distinct which filters out repeated values, and the standard order by syntax, which dictates the ordering of the aggregation syntax aggregate(\[distinct] arg1, arg2, \[order by ]) the order by syntax clause must be after all arguments to the aggregate function function syntax purpose array agg array agg(expr) returns an array containing every row from the expression example select array agg(c1 order by c1 desc) from sys dummy10 output int\[10,9,8,7,6,5,4,3,2,1] string agg string agg(expr, delimiter) returns a string concatenated from every row from the expression the delimiter argument is optional example select string agg(char(c1), '|' order by c1 asc) from sys dummy10 output "1|2|3|4|5|6|7|8|9|10" related links docid\ qtfpyds4dv4jap2 s6v g