how can i make a som from the second row
For example I have this result
Cuenta Numero Fecha
43424234 1 8/9/2022
43424234 1 8/10/2022
43424234 1 8/11/2022
43424234 1 8/12/2022
but I want to add from the second row, so that the result stays like this
Cuenta Numero Fecha
43424234 3 8/9/2022
The script is some basic example
SELECT Cuenta, Numero, Fecha
FROM Tabla
The first thing you need is a way to easily identify the first row so you can exclude it. An easy way is to use the
ROW_NUMBER()
.I leave an example with the creation of test data.