1
I need to make a report with SQL
, that asks me the following situation.
In the general report, I need it to stay that way:
Produto Quantidade Total Valor total
Salpicão 30kgs 810,00
The detail is, it needs to be the reports that contain the item "Total quantity" demand the total quantity of the product taking into account all orders made.
SELECT produto.nome, produto.tipo_medicao,
(select count(produto.valor) FROM produto) as total
FROM produto LIMIT 0, 1000
I started to do so but it is not right, follow the bank diagram:
What you’re looking for is called
GROUP BY
! Group the products by name.– Francisco