最近做一份统计报表,有日期(date),总金额(money), 现要统计每个月份金额对比上个月的增长率,头痛的事,
解决方案 »
- UDP远程传送文件 重复传送不了?
- 各位大侠,来俺就给分!程序中的最后的唯一问题
- 刚学DLL简单的问题路过的帮看看
- 请问如何将字符串拷贝到字符数组中?谢谢!
- 请教如何日期时间变量(TDatetime)进行加、减操作,以年为单位。
- 怎样规避异常?
- delphi7中的iw控件是做什么用的?
- 关于中级程序员的问题
- dy2712(大头) ,我想奢望一下,能不能给我一个关于通讯的例子。如果方便的话,我挺急的,我的mail: [email protected]
- 怎样制作DLL?
- 我要写一个程序在前台不需要运行后台运行可以:就像平时邮件服务品一样在前台不需要运行,而后台是提供服务的,要怎样来实现
- TIDHttpServer的用法
Create View YourView As Select AddMonths( YourMonth, -1 ), YourValue From YourTable;
然后是用下面的语句:
Select A.Month, A.Value, B.Value, ( B.Value / A.Value - 1 )
From YourTable A, YourView B
Where A.Month = B.Month;以上语句在Oracle上测试成功!!!
set @month=1while (@month=13) do begin
if @month=1 do begin
select (select sum(money)
from [view]
where month([data])=@month) / (select sum(money)
from [view]
where month([data])=12)
end
else begin
select (select sum(money)
from [view]
where month([data])=@month) / (select sum(money)
from [view]
where month([data])=@month-1)
end
end
Group By Month;