Aggregation within a group is simple. E.g. selecting the max salary from each department:
select max(salary) from table group by department
However, if you want to know the person's name whose salary is the highest in each department, it can not be simply done with a select and group by statement.
You probably need something slight more complex like below, not mentioning the downgrade in performance.
select t1.name, t1.salary from table t1 where not exists( select name from table t2 where t2.department = t1.department and t2.salary > t1.salary)
Oracle has built in some cool functions to assist this.
select max(name) KEEP (DENSE_RANK LAST ORDER BY salary desc) from table group by department
explanation: it runs a dense_rank for each group in descending order, and 'KEEP' the 'LAST' rank, which has the rows of the highest salary. Then select the max(name) from the rows of the highest rank, i.e. salary.