select a.item,a.money,b.money,b.money-a.money
from tab_income a, tab_income b
where a.item=b.item
and a.month=to_char(add_months(to_date(b.month,'yyyymm'),1),'yyyymm')
and a.month=200504
and a.money<b.money
from tab_income a, tab_income b
where a.item=b.item
and a.month=to_char(add_months(to_date(b.month,'yyyymm'),1),'yyyymm')
and a.month=200504
and a.money<b.money
解决方案 »
- 请教sql优化
- java 连接oracle
- 求电子书《大话ORACLE RAC》<ORACLE 高可用环境>
- em问题
- 数据库导入出错!
- 存储过程里直接生成文本文件??????????
- 怎么批量的把一批记录的ID更新为当前ID的最大值顺序加1呢?
- 关于日期函数的问题
- pro*c一个游标嵌套问题,无法解决,望大家帮忙
- ★★★简单问题,在线等待。我安装完了9i,启动Enterprise Manager Console,以独立启动方式运行。登录却说没有监听器,这是怎么回事?我
- Oracle 怎么学呢?我写了一些我现在学习到的东西,但感觉差很多,请大家给个建议!感激你的解或
- 帮忙解决一下这个问题,我都头疼好几天了!
from tab_income a, tab_income b
where a.item=b.item
and a.month=a.month+1
and a.money<b.money
select a.item,a.money,b.money,b.money-a.money
from tab_income a, tab_income b
where a.item=b.item
and a.month=b.month+1
and a.money<b.money
select item,income,month,income-lag(income,1) over (order by month) as l from
Tab_income order by month) where l<0