select a.dm,a.mc,b.sj from a,b where a.dm=b.dm(+);
解决方案 »
- 菜鸟问题
- 如何在已有小计的查询结果内进行某组数据内的排序呢?
- 连接Oracle数据库问题
- 安装了好几次Oracle92,服务里都没有OracleOraHome92ManagementServer,急?
- [新手问题]求助:两次操作之间的时间差
- 快帮帮我!!oracle的导入问题
- 怎样生成一个用户a 让他只能访问b用户下的表?
- 我建的DBLINK为什么总是报”ORA-12154: TNS: 无法处理服务名“的错呢?代码如下:
- 会者不难的问题,本人初学oracle,请各位帮忙!
- 整合时间点,找出各个时间区间
- ora-01599错误如何解决?
- 请教:oracle8i的ManagementServer无法认证?为什么?一定给分
select a.dm,a.mc,b.sj from a,b where a.dm=b.dm(+) order by a.dm
union
select b.dm,b.ac,b.sj from b where dm='00';
试试
只能嵌套了
select * from (select a.dm,a.mc,b.sj from a,b where a.dm=b.dm(+)
union
select b.dm,b.ac,b.sj from b where dm='00') order by dm ;
union
select b.dm as dm,b.mc as mc,b.sj as sj from b
order by dm;
(
select a.dm ,a.mc,b.sj
from a,b
where a.dm=b.dm(+)
and a.mc=b.mc(+)
union
select b.dm ,b.mc,b.sj
from a,b
where a.dm(+)=b.dm
and a.dm is null
) order by dm
(select a.dm,a.mc,b.sj
from a1 a,b1 b
where a.dm=b.dm(+)
union
select b.*
from b1 b) order by 1
as
select a1.dm,a1.mc,b.sj
from (select dm,mc from b
union
select dm,mc from a ) a1, t2 b
where a1.dm=b.dm(+)
order by 1;
但你的oracle版本必须是8i及以上版本,因为8i以下版本的视图中不能有order by。
from b
where not exists (select 'x' from a
where a.dm = b.dm
and a.mc = b.mc)
union all
select a.dm, a.mc, b.sj, 2 seq
from a, b
where a.dm = b.dm (+)
and a.mc = b.mc (+)
order by 4, 1, 2