postgreSQL Aggregate Functions
Simple statistics: min(), max(), avg()
In order to determine some simple statistics of a value in a column of a table, you can use an aggregate function.
You could write this statement to get the minimum, maximum and average value:
You can concatenate strings separated by delimiter using the string_agg() function.
You could write SELECT ... GROUP BY statement to get names from each country:
Note that you need to use a GROUP BY clause because string_agg() is an aggregate function.