Oracle SQL-连接语法/关键字 [英] Oracle SQL - Joins Syntax/Keywords

查看:67
本文介绍了Oracle SQL-连接语法/关键字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

查询Oracle数据库时:

When querying an Oracle DB:

如果查询是带有联接的选择,语法是否必须包含关键字:

If the query is a select with joins, does the syntax have to include the keywords:

  • 内部加入
  • 外加入
  • 左/右外联接

如果不是,那么替代用法/语法是什么?

If not, then what are the alternative usages/syntax?

之所以这样问,是因为我正在查看一个SELECT语句,该语句在FROM子句中不使用任何JOIN关键字,但是在WHERE子句中包含连接语法,我想知道:

I ask this because I am looking at a SELECT statement that does not use any of the JOIN keywords within the FROM clause, but includes the joining syntax within the WHERE clause, and I am wondering:

  • 如果所选内容正在执行JOIN
  • 如果是,查询的是哪种JOIN ?
  • if the select is executing a JOIN
  • if so, what kind of JOIN is it querying?

示例:

SELECT e.name, e.employeeid, d.sales, d.task, sum(d.hours)
FROM employee e,
       timecard d,
WHERE e.employeeid = d.employeeid and
GROUP BY ...
ORDER BY ...

推荐答案

是的,这是(内部)联接,可以重写为

Yes, this is a (inner) join, and could be rewritten as

SELECT e.name, e.employeeid, d.sales, d.task, sum(d.hours)
FROM employee e
JOIN timecard d on e.employeeid = d.employeeid
WHERE ...
GROUP BY ...
ORDER BY ...

这篇关于Oracle SQL-连接语法/关键字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆