I have the following tables in my MySQL DB:
produtos_pedido
with the following fields
id, order_id, product_id, qtd
produtos_troca
with the following fields
id, order_id, product_id, qtd
I need to make a SELECT
where I get the id_produto
(with distinct without repeating the product) and the qtd
(total, that is, summing the qtd of the same products), but I have to join the two tables.
Is this possible in MySQL?
Can anyone help me with this SELECT
?