Good morning, I'm creating a report on the ABC curve, but I'm a beginner and I still have some difficulties.
I have a table called: ITEMS. With fields: COD_ITEM, Sales Quantity, Unit Value, Subtotal, Description
With an SQL query I was able to bring the total sales value:
SELECT SUM(SUBTOTAL) AS SUBTOTAL FROM ITENS
ORDER BY SUBTOTAL
And with another query that I did not understand because it did not work, it brings up the fields I requested, but they are not "added" by getting several records of the same item.
SELECT COD_ITEM, QuantidadeVenda, Descricao, ValorUnitario,
Subtotal FROM ITENS
GROUP BY COD_ITEM, QuantidadeVenda, Descricao, ValorUnitario,
Subtotal
What you would really need to bring is a select that shows compared to the total sales how many percent represents each item