如何找到两列数据之间的差异? [英] How to find difference between two columns data?
本文介绍了如何找到两列数据之间的差异?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个包含两列整数数据的临时表,我想找出第三列中两列之间的差异.
I have a temp table with two columns of integer data i want to find the difference between two columns in 3rd column.
#TEMP1
Present previous
59 88
75 75
45 45
77 88
09 08
#temp2
Difference
29
0
0
11
-1
这可能吗??
推荐答案
select previous, Present, previous-Present as Difference from tablename
或
select previous, Present, previous-Present as Difference from #TEMP1
这篇关于如何找到两列数据之间的差异?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文