Why cannot we just use max() with group by?
select D.name as Department, E.name as Employee, max(salary) as Salary \n        from Employee E , Department D \n        where E.DepartmentId = D.Id  \n       
    select D.name as Department, E.name as Employee, max(salary) as Salary \n        from Employee E , Department D \n        where E.DepartmentId = D.Id  \n        group by D.id\n\nI tried to use something like this, but it did not pass. When two departments has the same max salary, it only outputs one row.\n\nHowever, this is not how it works in my local mysql.\n\nWhy is this wrong?
[]