select a.id,a.info_a,b.b_info from table_a a,table_b b where a.id=b.id
order by a.id
order by a.id
解决方案 »
- oracle10g 用exp备份提示ORA-12154: TNS: 无法解析指定的连接标识符
- 请教:使用JPA往Oracle中写数据,传入的是整数,结果写入的却是数据却是随机浮点
- oracle计算时间
- sys_connect_by_path 在ORACLE8怎么用
- 请教这样怎么排序
- 请问用pl/sql怎样连接oracle 10g
- 菜鸟问题,求助!
- oracle里怎么创建普通用户?
- 如何导入导出的数据库(包含表,对象等)?急
- 有关用户和方案,请高手解释一下!
- 如何将Oracle的数据表结构和数据导成.sql文件?
- 请问在oracle中对完整sql语句的审计结果保存在那个表中?我在aud$中没有找到。
谢谢!!!
select A.ID,A.Info_A,B.Info_B from Table_A A,Table_B B where B.ID=A.ID(+) order by A.iD
总之主表,附表的关系一般是这样的:主表.col=附表.col(+)
from table_a a,table_b b
where a.id=b.id
union all
select a.id,a.info_a,' '
from table_a a
where not exists(select 1 from table_b where a.id=b.id)
union all
select a.id,' ',b.info_b
from table_b b
where not exists(select 1 from table_a where a.id=b.id)
order by 1
from table_a a,table_b b
where a.id=b.id
union all
select a.id,a.info_a,' '
from table_a a
where not exists(select 1 from table_b b where a.id=b.id)
union all
select a.id,' ',b.info_b
from table_b b
where not exists(select 1 from table_a a where a.id=b.id)
order by 1
FROM table_a a,table_b b
WHERE a.id = b.id
UNION ALL
SELECT a.id,a.info_a,b.b_info
FROM table_a a,table_b b
WHERE a.id = b.id(+)
AND b.id IS NULL
UNION ALL
SELECT a.id,a.info_a,b.b_info
FROM table_a a,table_b b
WHERE a.id(+) = b.id
AND a.id IS NULL
ORDER BY 1