Home > Database > Oracle > How to use natural join in multi-table queries in Oracle?

How to use natural join in multi-table queries in Oracle?

coldplay.xixi
Release: 2020-07-17 16:13:31
Original
3950 people have browsed it

How to use natural join for multi-table queries in oracle: 1. Automatically match the same columns in the two tables; 2. Specify the columns that need to be displayed; 3. When using natural joins, you cannot specify the columns to be displayed. Specify the table name or table alias.

How to use natural join in multi-table queries in Oracle?

How to use natural join for multi-table queries in oracle:

1. There is no need to specify a connection in oracle natural join condition, it will automatically match the same columns in the two tables (take the two emp dept tables under user scott as an example).

How to use natural join in multi-table queries in Oracle?

How to use natural join in multi-table queries in Oracle?

2. In the natural connection, you can specify the columns that need to be displayed

How to use natural join in multi-table queries in Oracle?

3. When using natural joins, you cannot specify a table name or table alias for the column to be displayed.

How to use natural join in multi-table queries in Oracle?

4. When using natural joins, if two If two fields are the same, they will also be matched automatically. (Two tables under the hr user as an example)

How to use natural join in multi-table queries in Oracle?

How to use natural join in multi-table queries in Oracle?

5. In fact, although the query methods of natural join and where conditional join are Not the same, but the query results are the same, except that the statement is ideally simplified when using natural joins. As shown below

How to use natural join in multi-table queries in Oracle?

How to use natural join in multi-table queries in Oracle?

##Related learning recommendations:

oracle database learning tutorial

The above is the detailed content of How to use natural join in multi-table queries in Oracle?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template