Skip to content
Advertisement

SQL Select Adding a new row with difference between numbers

I have this query that give the sum between years but I want to add a new row at the end of each TARMA that give the differences between the years.

Here is the query:

And here is the result without the difference: [Result][1]

For example:

TARMA: 454 for X98

2014: 1849.14077

2015: 2571.47750

Difference: -722,33673

I’m using MS SQL. Is it with a UNION?

How can I get the difference?

Advertisement

Answer

I got it:

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement