加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

oracle sql中的join关键字和inner join关键字有什么区别?

发布时间:2020-12-12 13:48:07 所属栏目:百科 来源:网络整理
导读:参见英文答案 Difference between JOIN and INNER JOIN7个 我找不到关键词加入的文档,但我看到使用它的网络上的例子. 我在Oracle hr模式中做了一些实验,在那里我有表部门: deparment_name manager_id location_id 表员工: first_name employee_id 和桌子位
参见英文答案 > Difference between JOIN and INNER JOIN7个
我找不到关键词加入的文档,但我看到使用它的网络上的例子.

我在Oracle hr模式中做了一些实验,在那里我有表部门:

> deparment_name
> manager_id
> location_id

表员工:

> first_name
> employee_id

和桌子位置:

> location_id
>城市

查询应返回部门经理的department_name,first_name以及部门所在的城市.

与使用关键字inner join相比,使用关键字join的代码似乎返回一些结果

加入代码:

select d.department_name,e.first_name,l.city
from departments d
   join employees e on d.manager_id=e.employee_id
   join locations l on d.location_id=l.location_id

内连接代码:

select d.department_name,l.city
from departments d
   inner join employees e on d.manager_id=e.employee_id
   inner join locations l on d.location_id=l.location_id

两种情况有区别吗,或者我刚刚碰到一个结果相同的情况呢?

>以下1992年ANSI SQL参考,INNER is optional:

Query expressions 179 7.5 – joined table

3) If a qualified join is specified and a join type is not
specified,then INNER is implicit.

>遵循Oracle标准(9i之后),INNER前缀也是可选的.在9i之前,Oracle没有遵循ANSI规则,甚至没有支持JOIN语法.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读