Question: Suppose we have a table #temp1, what we required here is, we want an additional column **ABC** and in that, we want to print the output as *(10-10 = 0), (20-10) = 10, (30-10 = 20), (40-10 = 30) and (50-10 = 40)*

So, we have created a table and insert script below.

```
Create table #temp1 (ID Int Identity(1,1),Name varchar(10),Series bigint)

insert into #temp1 values('A',10)
insert into #temp1 values('B',20)
insert into #temp1 values('C',30)
insert into #temp1 values('D',40)
insert into #temp1 values('E',50)

```

I tried as below, where its incrementing the values rows by rows.

```
select ID,Name,Series, SUM(series) over(order by series asc Rows Between Unbounded Preceding and Current Row) ranking from #temp1

```

Output should be:

```
ID|Name|Series|ABC
1 |  A |  10  | 0
2 |  B |  20  | 10
3 |  C |  30  | 20
4 |  D |  40  | 30
5 |  E |  50  | 40

```

Can anyone here me, how to do that.

Answer: 
It's simply `Series - 10`:

```
SELECT ID, Name, Series, Series - 10 AS ABC
FROM #Temp1;

```
select ID,Name,Series,(series - 10) as abc from #temp1