oracle 中多表连接如何用

如题所述

以两表为例:

有以下两张表:

现在要通过deptno字段,在查询中显示emp表中全部内容和dept表中的dname字段。

可用如下语句:

select a.*,b.dname from emp a,dept b where a.deptno=b.deptno;

查询结果:

温馨提示:答案为网友推荐,仅供参考
第1个回答  2013-08-18
– 左连接通用写法:select * from a left join b on a.id=b.id
– 右连接通用 写法:select * from a right join b on a.id=b.id
– 全连接通用 写法:select * from a full join b on a.id=b.id
– 左连接Oracle 写法:select * from a,b where a.id=b.id( )
– 右连接Oracle 写法:select * from a,b where a.id ( ) =b.id本回答被网友采纳
相似回答