0
I’m trying to run this update but it only updates the "value" column if the "discount" column is different from 0.00. If it is 0.00 he enters the second condition of the IF and puts in value the value of himself. If different, it makes the original value calculation - discount. Can anyone help me understand why this is happening?
UPDATE pagamento
SET
valor = IF(caminho = '2',valor_original - desconto, valor)
WHERE
codigo = 5
X - 0 = X ... what’s the problem ?
– Motta