|
Main Menu
Resources
|
SQL GROUP BY
GROUP BY clause is used to associate an aggregate function with groups of rows.
The SQL syntax for GROUP BY is : SELECT AGGREGATE FUNCTION ( [COLUMN NAME] )
We can use GROUP BY clause to calculate sum of the scores by Department. Table GameScores
SQL statement : SELECT Department, SUM(Scores) Result:
We can use GROUP BY clause to calculate the number of contestants by Department. SQL statement : SELECT Department, COUNT(*) Result:
|
|||||||||||||||||||||||||||||||||||||

Printer friendly page