0
I have an exercise to do but I’m cracking my head here:
"SQL command that brings me the sum of the salaries received per employee and status in the year 2014 of the tables: SALARIES / EMPLOYEES / LOCAL_DE_TRABALHO".
I’ve already created and filled all the tables, now I’m trying to make the query.
SELECT SUM(VALOR_PAGO) as total_pago, NOME_COLABORADOR as colaborador,
DATA_PAGAMENTO as Data_pagamento
from COLABORADORES Inner join SALARIO
on SALARIO.ID_COLABORADOR = COLABORADORES.ID_COLABORADOR
WHERE YEAR(DATA_PAGAMENTO) = 2014
Error:
The column 'CONTRIBUTORS.NOME_COLABORADOR' is invalid in the selection list because it is not contained in an aggregation function or in the GROUP BY clause.
Did Groupby miss? Isn’t that it.
– novic