Difference between revisions of "Column name"

From SQLZOO
Jump to: navigation, search
(Created page with "How can I display a column name for an aggregate function? <div class='ht'> <div> Where one of the results returned is calculated (for example with an aggregate) the column n...")
 
Line 1: Line 1:
 
How can I display a column name for an aggregate function?
 
How can I display a column name for an aggregate function?
 
<div class='ht'>
 
<div class='ht'>
 +
<div class=params>schema:gisq</div>
 
<div>
 
<div>
 
Where one of the results returned is calculated (for  
 
Where one of the results returned is calculated (for  
Line 11: Line 12:
 
</source>
 
</source>
 
<source lang='sql' class='def'>SELECT region, SUM(population) AS x
 
<source lang='sql' class='def'>SELECT region, SUM(population) AS x
   FROM cia
+
   FROM bbc
 
GROUP BY region
 
GROUP BY region
 
</source>
 
</source>

Revision as of 13:15, 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
Personal tools
Namespaces

Variants
Actions
Reference
Toolbox
Google AdSense