I have a SELECT
with SUM
and would like to understand how do I return the lowest sum value of all values per provider.
SELECT distinct fornecedor, cliente, SUM(valor*qtd) AS TOTAL FROM orcamentos
WHERE idOrcamento ='$orcamento' group by fornecedor;
The table sums all values for each vendor.
I need the result to show me the lowest value found among vendors.
Example This search returned above
| supplier | Customer | TOTAL |
| 1 | 1