I have the following table:
I need a number of different offices in each department:
I made the following query, but it is not what the statement asks:
SELECT depto_no, count(*)
FROM empleado
GROUP BY depto_no
The issue is that I already tried to put DISTINCT
in SELECT
, I also tried to put a subquery in FROM
(I do not know if it's okay to do it that way).
The result should be as follows:
depto_no valor
10 1
20 1
30 2 (los dos oficios distintos)
40 1