I have a table where is recorded each employee carreer in my enterprise.
This is my table:
employee_id | date | function
The last date I have for each employee corresponds to the present function of that employee in my enterprise.
How can I know how many employees I have in each function at the present time?
I tried this one without success

:
select id_function, count(id_function) from
(select id_employee, max(id_function) from carreer group by id_employee) group by id_function;
Thanks in advance.