Reputation: 3
In getting the not a single-group group function error on this query, how can I solve this?
select to_char(fecha_ingreso,'DY') dia,
count(num_dept) n
from empleados
group by dia
Upvotes: 0
Views: 177
Reputation: 17643
The question is too simple, you should write:
select to_char(fecha_ingreso,'DY') dia,
count(num_dept) n
from empleados
group by to_char(fecha_ingreso,'DY')
This is because select clause is evaluated after the group by clause.
Upvotes: 4