Link to home
Start Free TrialLog in
Avatar of gudii9
gudii9Flag for United States of America

asked on

order by query with group by

SELECT Department, SUM(Salary) FROM SALARIES GROUP BY DEPARTMENT ORDER BY SUM(Salary) DESC LIMIT 1;

SELECT Department, SUM(Salary) FROM SALARIES GROUP BY DEPARTMENT ORDER BY AVG(Salary) DESC LIMIT 1;

SELECT Department, SUM(Salary) FROM SALARIES GROUP BY DEPARTMENT ORDER BY Salary DESC LIMIT 1;

how above three queries are different? please advise
ASKER CERTIFIED SOLUTION
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial