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
解决方案 »
- 求个oracle的触发器
- 忘记sys,system和sysman的口令,,如何进入系统
- ORACLE数据库中大数据量操作那种更好
- 去掉字段数据间得空行
- 服务内设的数据库名为A,set oracle_sid=A,但tnsping A不能OK,搞不懂了,就TNSNAMES.ORA设了个A_db
- 表的解锁?
- 救命!这个是因为数据库为空的缘故吗?
- execute immediate?
- 怎么在sql*plus中以normal身份登陆?
- 日期字段条件为什么直接传日期变量比TO_DATE()传字符串慢10倍?
- 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