Q. Gopi Krishna is using a table Employee. It has the following columns:
Code, Name, Salary, Deptcode
He wants to display maximum salary department wise. He wrote the following command:
SELECT Deptcode, Max(Salary) FROM Employee ;
But he did not get the desired result.
Rewrite the above query with necessary changes to help him get the desired output.
Answer :-
SELECT Deptcode, Max(Salary)
FROM Employee
GROUP BY Dept Code;
What if we donot write dept code as column
ReplyDeleteBut Question say to group the data by deptcode.
Deletei dont understand
ReplyDeleteTell me your problem
DeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )