1
I’m trying to add the value of id 1 and the value2 of id 2 which in this case would be equal to 220, as I do this consultation?
ID VALOR VALOR2
---------- ---------- ----------
1 110 100
2 100 110
this was the select I was trying to, but not the right one
select valor+valor2 from teste3 where valor = (select valor from teste3 where id = 1 and valor2 = (select valor2 from teste3 where id = 2))
is the value of ID 1 + VALOR2 of ID 2, in case 110+110
– Harry
https://docs.microsoft.com/pt-br/sql/t-sql/queries/select-over-clause-transact-sql use the OVER()
– Motta
I don’t understand what you need, a cumulative total ? a general total ?
– Motta