I'm trying to make a SUM
in a query that performs some calculations. Here's the example:
SELECT
SUM ( (qtd - qtd_devolucao) * valor AS total)
FROM
produtos
WHERE
id_pedido = '47'
I'm having the following error:
# 1064 - You have a syntax error in your SQL next to 'AS total'