我有一個名爲Addim表和數據的樣子:差異,每天的數據
TName Idate Number
Integrated 3/21/2012 26984013
Integrated 3/20/2012 26959226
Integrated 3/19/2012 26933190
我想要的輸出:
Idate Diff
3/21/2012 24787
3/20/2012 26036
我做了這樣的事情:
Select Count(*),Idate
from dbo.Addim
group by Idate
但我得到這樣的輸出:
Idate Diff
03/21/2012 1
03/20/2012 1
基本上它是它從 前一天例如區別: 爲3/21/2012 the diff is 26984013(3/21/2012)-26959226(3/20/2012) = 24787
和
2012/3/20是26959226(2012/3/20)-26933190(3/19/2012 )= 26036
太棒了非常感謝你 – peter 2012-03-21 20:33:07