title: How to write an SQL query for this scenario?
body: <p>I have a table containing attributes <code>Id, Emp_name, dept_name, salary</code>. Now i want to write an SQL query that will give me the <code>dept_name</code> value for which the overall salary of all employees belonging to that department is the highest, i.e dept for which sum of salaries of all its employees is the highest...? If there is any similar question with answer on stackoverflow, please suggest.. I dint find one. Thanks :) </p>
  
  <p>I tried <code>group by</code> with <code>sum()</code> function, but i could not get how to find the maximum and compare it with sum.</p>