0
I made a query that adds a decimal field, only I’m having trouble, because when I put the clause group by t1.id_sell
it lists me sales but no longer sums correctly and without the correct sum clause but only returns me a 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
It would be nice for you to create tables with minimal structure and content that reproduce the problem and post along with the question to facilitate the work of those who propose to answer.
– Reginaldo Rigo