select distinct year, month, max(sjz), max(yjz) from
(select year, month, money as sjz, 0 as yjz from a
union all
select year, month, 0 as sjz, money as yjz from b)
(select year, month, money as sjz, 0 as yjz from a
union all
select year, month, 0 as sjz, money as yjz from b)
解决方案 »
- 如何获得远程ORACLE客户端的信息,如IP
- 求救!用PL/SQL Developer7 远程访问Linux下的Oracle11g出问题
- oracle10g定时备份和恢复的问题请教!!!
- 小弟弱弱的问一下,下面这个查询,该怎么优化
- 高分求教,MSSQL的一个数据库转换成ORACLE要求稳定转换
- 咨询一个索引的问题。
- Microsoft odbc for oracle 出错,请帮帮忙!!
- 如何免费获取oracle和mysql的盗版,要功能无限制的
- 请问连接Oracle数据库的初始化ADO语句?
- Oracle大提速
- imp的时有错误,求教,急!
- 请有经验的大侠指点:如何管理alert_*.log文件?
(select a.year as y,a.month as m,a.money as mo from a
union
select nvl(a.year,b.year) as y,nvl(a.month,b.month) as m,nvl(a.money,b.money) as mo from a,b where
a.month(+)=b.month) t1,
(select b.year as y,b.month as m,b.money as mo from a,b where a.month=b.month) t2 where t1.m=t2.m(+)
decode(a.year,null,b.year,a.year),
decode(a.month,null,b.month,a.month),
decode(a.money,null,0,a.money),
decode(b.money,null,0,b.money)
from ss_tmonth_revenue a
full join predict_revenue_month b
on b.nid = a.nid and b.year = a.year and b.month = a.month;