GROUP BY - Multiple Grouping Columns - What if?

What if you ALSO want to display their lastname for the query below:

SELECT max(salary), dept
FROM employee
GROUP BY dept;

What you'll need to do is:

SELECT lastname, max(salary), dept
FROM employee
GROUP BY dept, lastname;

This is a called "multiple grouping columns".

 

Go Back to previous GROUP BY clause page

Share:
Home
Mobile Site | Full Site
Copyright 2017 © QuinStreet Inc. All Rights Reserved