I need to make a report with SQL
, which asks me the following situation.
In the general report, I need it to look like this:
Produto Quantidade Total Valor total
Salpicão 30kgs 810,00
The detail is, it is necessary that the reports that contain the item "Total quantity" demand the total quantity of the product taking into account all the orders made.
SELECT produto.nome, produto.tipo_medicao,
(select count(produto.valor) FROM produto) as total
FROM produto LIMIT 0, 1000
I started doing this but it is not right, follow the bank diagram: