NATURAL JOIN
来源:互联网 发布:上古卷轴5帧数优化mod 编辑:程序博客网 时间:2024/05/17 02:24
NATURAL JOIN The NATURAL
keyword indicates that a natural join is being performed. A natural join is based on all columns in the two tables that have the same name. It selects rows from the two tables that have equal values in the relevant columns. When specifying columns that are involved in the natural join, do not qualify the column name with a table name or table alias.
On occasion, the table pairings in natural or cross joins may be ambiguous. For example:
a NATURAL LEFT JOIN b LEFT JOIN c ON b.c1 = c.c1
can be interpreted in either of the following ways:
a NATURAL LEFT JOIN (b LEFT JOIN c ON b.c1 = c.c1) (a NATURAL LEFT JOIN b) LEFT JOIN c ON b.c1 = c.c1
To avoid this ambiguity, you can use parentheses to specify the pairings of joined tables. In the absence of such parentheses, the database uses left associativity, pairing the tables from left to right.
Restriction on Natural Joins You cannot specify a LOB column, columns of ANYTYPE
, ANYDATA
, or ANYDATASET
, or a collection column as part of a natural join.
1.如果做自然连接的两个表的有多个字段都满足有相同名称个类型,那么他们会被作为自然连
接的条件。
2.如果自然连接的两个表仅是字段名称相同,但数据类型不同,那么将会返回一个错误。
3.由于oracle中可以进行这种非常简单的natural join,我们在设计表时,应该尽量在不同表
中具有相同含义的字段使用相同的名字和数据类型。以方便以后使用natural join
89. View the Exhibit and examine the description of the DEPARTMENTS and
EMPLOYEES tables.To retrieve data for all the employees for their EMPLOYEE_ID,
FIRST_NAME, and DEPARTMENT NAME,the following SQL statement was written:
SELECT employee_id, first_name, department_name
FROM employees
NATURAL JOIN departments;
The desired output is not obtained after executing the above SQL statement.
What could be the reason for this?
A. The NATURAL JOIN clause is missing the USING clause.
B. The table prefix is missing for the column names in the SELECT clause.
C. The DEPARTMENTS table is not used before the EMPLOYEES table in the FROM
clause.
D. The EMPLOYEES and DEPARTMENTS tables have more than one column with the
same column name and data type.
Answer: D
Obtained:
- NATURAL JOIN
- 自然连接 natural join
- ocp-047 natural-join
- natural join 为何物
- oracle-using/natural join
- ORA-00933 与 NATURAL JOIN
- MySQL STRAIGHT_JOIN 与 NATURAL JOIN
- oracle natural using join 区别
- Oracle natural join(自然连接)
- Oracle natural join(自然连接)
- 自然连接(NATURAL JOIN)
- 自然连接(NATURAL JOIN)
- 9.3.2 自然连接(NATURAL JOIN)
- MySQL STRAIGHT_JOIN 与 NATURAL JOIN(五)
- OCP-047 NATURAL JOIN and USING
- NATURAL JOIN--自然连接的一些注意事项
- SQL自然联接(NATURAL JOIN)
- Oracle natural join(自然连接)
- 王垠:如何掌握程序语言
- sqlite的几个常用方法
- Myeclipse下使用svn碰到Secure connection truncated (https:)解决方法
- Warning: Cannot modify header information出现这样的情况如何解决?
- C# 正则表达式实现字符串搜索
- NATURAL JOIN
- Android-LayoutAnimationCotroller和AnimationListener监听器的使用
- K Nearest Neighbor 算法
- 我要学ASP.NET MVC 3.0(十七): MVC 3.0 实例之表格中数据的筛选
- 我使用过的Linux命令之dmesg - 查看开机信息/打印或控制内核环形缓冲区
- 网络编程:优雅关闭socket/TIME_WAIT/CLOSE_WAIT/SoLinger
- 苹果为什么收购AuthenTec:“神秘技术”将用于下一代iPhone
- Spring集成CXF
- QTextCodec类更换中文编码环境出错问题