I have a view in sqlServer in which I do the following select
SELECT mes
,P117_Dias_Trabajados
,P004_Dias_Falta
,P002_Dias_Permisos_CG
,P003_Dias_Permisos_SG
,P003_Dias_Licenicas_Comun
,P003_Dias_Licencias_Loborales
,P003_Dias_No_Contratados
FROM v_TPersonal_Asistencia
WHERE ficha='11117454'
which gives me the following result (image1)
What I want is to show me one row for each mes
(image2)
he intentado agrupar los valores por 'mes' pero me da el siguiente error:
La columna 'v_TPersonal_Asistencia.P117_Dias_Trabajados' de la lista de selección no es válida, porque no está contenida en una función de agregado ni en la cláusula GROUP BY.
and when adding the other fields it shows the same result as in the image1,