I made a query that adds a decimal field, but I'm having a problem, because when I put the group by t1.id_sell
clause it lists the sales but no longer adds correctly and without the correct sum clause but only returns one line.
query:
SELECT Sum(t1.preco_sell) AS result_sum, t1.*, t2.name, t3.name_produto
FROM tb_sell t1
INNER JOIN tb_user t2
ON t1.id_user = t2.id_user
INNER JOIN tb_produtos t3
ON t1.id_produto = t3.id_produto
WHERE t1.status = 2
GROUP BY t1.id_sell