SQL
Limitations
`PIVOT` currently only accepts an aggregate function, expressions are not allowed.
For example, the following query attempts to get the population as the number of people instead of thousands of people (i.e., instead of 564, get 564000):  
```sql
PIVOT cities
ON year
USING sum(population) * 1000;
```  
However, it fails with the following error:  
```console
Catalog Error: * is not an aggregate function
```  
To work around this limitation, perform the `PIVOT` with the aggregation only, then use the [`COLUMNS` expression](#docs:sql:expressions:star::columns-expression):  
```sql
SELECT country, name, 1000 * COLUMNS(* EXCLUDE (country, name))
FROM (
PIVOT cities
ON year
USING sum(population)
);
```