GROUP BY Clause Examples | SQL SELECT Statements | Teradata Vantage - Example: Simple GROUP BY Operation - Advanced SQL Engine - Teradata Database

SQL Data Manipulation Language

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
Published
September 2020
Language
English (United States)
Last Update
2021-01-23
dita:mapPath
qtb1554762060450.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1146
lifecycle
previous
Product Category
Teradata Vantage™

Generate a report of salary totals by department, the result might look something like the report that follows.

     SELECT dept_no, SUM(salary)
     FROM employee
     GROUP BY dept_no;

The result might be similar to the report that follows.

dept_no

-------

SUM(salary)

-----------

100 180,500.00
300 143,000.00
500 268,000.00
600 146,600.00
700 113,000.00