+3 votes
in Class 12 by kratos

Gopi Krishna is using a table Employee. It has the following columns: Code, Name, Salary, Deptcode. He wants to display maximum salary departmentwise. He wrote the following command: SELECT Deptcode, Max( Salary) FROM Employee; But he did not get the desired result. Rewrite the above query output with necessary changes to help him get the desired result.

1 Answer

+6 votes
by kratos
 
Best answer

SELECT Deptcode, Max( Salry) FROM Employee GROUP BY Deptcode ;

...