0
Galera mounted the following select in MYSQL:
SELECT
id_produto,
SUM(qtd) as qtd
FROM
(
SELECT
id,
id_produto,
qtd
FROM
produtos_pedidos
WHERE
id_pedido = '1'
UNION ALL
SELECT
id,
id_produto,
qtd
FROM
pedidos_barganha
WHERE
id_pedido = '1'
and tipo = 'b'
) res
GROUP BY
id_produto
I run it on PHPMYADMIN and it works, but it’s giving some errors in the editor, and I don’t know what it might be.
Which editor you are using?
– carla
@Carla phpmyadmin
– Hugo Borges
have you tried another http://sqlfiddle.com/#! 2 editor? see if it helps
– KingRider