我写了一个,在Oracle8i中测试通过:select a.ActDate 日期, a.ActCount 数量,a.ActCount+ (select nvl(max(ActCount),0) from test b where b.ActDate<a.ActDate) 累计数量
from test a
from test a
解决方案 »
- 如何将Date型yyyy-mm-dd hh24:mi:ss字段转换获取yyyy-mm-dd
- 请教数据库设计
- oracle for AIX安装报错
- 求教,展示下及科目方式
- Oracle10g表名、字段名可不可以忽略大小写
- oracle 如何导出数据库所有表某一年的数据
- 急,pl/sql deve创建存储过程出错, status 为 INVALID
- 请问怎样停止正在运行的作业?
- ??用exp导出表时,出现如下问题(用sqlplus也是),tns可以正常启动。请帮助!
- 求sql语句!!很急!!!
- 各位,我在java中连接oracle数据库,出现了点问题,请问是什么原因,谢谢!
- 急——用存储过程解决自增字段的问题
select a.ActDate 日期, a.ActCount 数量,a.ActCount+ (select nvl(sum(ActCount),0) from test b where b.ActDate<a.ActDate) 累计数量
from test a
from yourtable a
from yourtable a
Y) 累计数量 from student a order by BIRTHDAY;日期 数量 累计数量
---------- ---------- ----------
19-12月-02 10 10
20-12月-02 20 30
21-12月-02 30 60
22-12月-02 40 100
return number
is
cursor v_cursor(v_date date) is
select sum(id) id from student where BIRTHDAY <=v_date ;
records number:=0;
begin
for v_val in v_cursor(p_date)
loop
records:=records+v_val.id;
end loop;
return(records);
end get;
/SQL> select BIRTHDAY 日期, id 数量, get(birthday) 累计数量 from student order by BIRTHDAY;日期 数量 累计数量
---------- ---------- ----------
19-12月-02 10 10
20-12月-02 20 30
21-12月-02 30 60
22-12月-02 40 100