3
I own a SELECT
and in it I display the sum of the sales values of each product, I would like 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
You helped me the way you wanted, thank you very much, man. Only in the first solution I found error of Incorrect Parameter Count in the call the Native Function "ISNULL" but, the second worked
– user92870
@Victort., replaces ISNULL with COALESCE. The error must now have been corrected.
– bruno
Yes, thank you very much man
– user92870