SQL
Simplified `PIVOT` Syntax
An alias may also be included for each expression in the `USING` clause.
It will be appended to the generated column names after an underscore (` _`).
This makes the column naming convention much cleaner when multiple expressions are included in the `USING` clause.  
In this example, both the `sum` and `max` of the population column are calculated for each year and are split into separate columns.  
```sql
PIVOT cities
ON year
USING sum(population) AS total, max(population) AS max
GROUP BY country;
```  
<div class="narrow_table"></div>  
| country | 2000_total | 2000_max | 2010_total | 2010_max | 2020_total | 2020_max |
|---------|-----------:|---------:|-----------:|---------:|-----------:|---------:|
| US      | 8579       | 8015     | 8783       | 8175     | 9510       | 8772     |
| NL      | 1005       | 1005     | 1065       | 1065     | 1158       | 1158     |