Difference between revisions of "Column name"
From SQLZOO
| Line 9: | Line 9: | ||
You should be able to specify a column name. | You should be able to specify a column name. | ||
</div> | </div> | ||
| − | <source lang=sql class='tidy'> | + | <source lang=sql class='tidy'></source> |
| − | </source> | + | <source lang=sql class='setup'></source> |
<source lang='sql' class='def'>SELECT region, SUM(population) AS x | <source lang='sql' class='def'>SELECT region, SUM(population) AS x | ||
FROM bbc | FROM bbc | ||
Latest revision as of 13:16, 12 July 2012
How can I display a column name for an aggregate function?
schema:gisq
Where one of the results returned is calculated (for example with an aggregate) the column name may be assigned arbitrarily.
You should be able to specify a column name.
SELECT region, SUM(population) AS x FROM bbc GROUP BY region