Opa,
I am adding the total of a double column, what I need is that, the query does not add up this column if the Cod column is equal. Explaining better, the column can be repeated, if it repeats the value of the discount column will also repeat itself, that is, do not add the discount if you have another equal cod
Select sum(desconto) From ordem where cod != cod and data='2015-10-29'