Sunday, April 14, 2013

GROUP BY - Multiple Grouping Columns - What if?

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".

If you are searching life partner. your searching end with kpmarriage.com. now kpmarriage.com offer free matrimonial website which offer free message, free chat, free view contact information. so register here : kpmarriage.com- Free matrimonial website

0 comments:

Post a Comment