1
good afternoon! Thank you for your time. I’m starting in SQL (and programming as a whole!).
At my base, I have several lines for the NRPROT with different prices, low values and different resource. What I need is to group the NRPROT and its respective values. I do not know if it was clear... but I assembled the query below and Access does not allow. It says that values are missing for aggregation. I should put all the columns that are in select?
SELECT
NRPROT,
CODCONTR,
MARCA,
NRPROT,
DTPGTO,
VALORRECURSO,
VALORBAIXA,
VLRGLO,
VLRGLO * 0.47 AS NEGOCIACAO_RECURSO,
VLRGLO * 0.53 AS NEGOCIACAO_BAIXA
FROM TESTE_1
GROUP BY NRPROT;
the "group by" asks you to put all fields that are before From, in the order you want to group
– GabrielLocalhost
Thank you! I did not know this "detail". rs
– Raphael Pires