I want to find the biggest sale for each of my employees (and display the name of the employee). In MySQL, this is pretty simple:
select *
from employee, sale
where employee.id = sale.employee_id
group by employee_id
order by sale.total desc
This is pretty much what you would expect, it will return a list of employees and eventually return the largest sales record with a number of employees.
But Oracle does not allow you to return columns that are not group expressions when using the group by clause. Does this do what I do in MySQL "impossible" in Oracle? Or is there some workaround? I suppose I could do some kind of subquery, but I'm not sure if there is another way to do this, which is not so difficult to build.
source
share