2
I have 3 tables
Table Produtos
with the columns id
,descricao
,peso
.
Table op_itens
with the columns id_op
, id_prod (chave estrangeira da tabela Produtos com a coluna id)
, qtd
.
I want to make a sum of the total weight of the Table op_items
example:
Table Products
id.| Description.| weight
1 |Pencils......|0,12
2 |Rubber...|0,02
Table op_items
id.| id_prod.| Qtd
1..|1...........| 5
1..|2...........| 10
I would like a result of the total quantity of items which in this case is 15. and total weight that would be 0.8
I tried several commands SELECT SUM
, but is returning me values that is not correct.
It worked out even, you do not realize the mega complicated codes I found example, and its very easy.
– Junior
I’m glad I helped. Success there !!
– Lindomar Lemos