How to take differentiate this value in TSQL?

47 views Asked by At

We have a simplified table like this:

TYPE; VALUE
AA; 10
BB; 7
CC; 12

I want to do calculation based on TYPE AA & BB so 10 - 7 = 3

How do I achieve this?

Thanks

1

There are 1 answers

2
Burcin On BEST ANSWER

select A.TYPE - B.TYPE from table A, table B where A.TYPE = 'AA' and B.TYPE = 'BB'