I have a SELECT
and in it I display the sum of the sales values of each product, would I have to make a total sum of the table that made the sum?
SELECT
cadpro.descricao,
sum(itensped.total_venda) AS total_venda
FROM itensped
INNER JOIN pedido ON
itensped.id = pedido.id
NNER JOIN cadpro ON
itensped.id_cadpro = cadpro.id
INNER JOIN cadgrp ON
cadpro.id_grupo = cadgrp.id
WHERE pedido.empresa = 1
AND pedido.filial = 1
AND pedido.data_venda BETWEEN '2017-05-01' AND '2017-05-31'
AND total_venda > 0
GROUP BY cadgrp.nome_grupo
ORDER BY total_venda DESC LIMIT 10
Select result wanted to make a total sum of total_venda