ORACLE table connection

Source: Internet
Author: User

ORACLE table connection details in ORACLE, table connection methods mainly include: internal connection, external connection, self connection: internal connection: This is the most common connection Query

SELECT * from a inner join B ON. ID = B. IDSELECT * from a join B ON. ID = B. IDSELECT * from a, B WHERE. ID = B. ID

 

The query results of the preceding statements are the same, and they are used for inner join. External Connection:
Left join, right join, FULL JOIN

 

During external join queries, you need to understand that the base table and the matching table are all the tables shown in records, and the matching table is the table that displays records with matching conditions, if the record row does not match, the corresponding field is displayed as NULL. Therefore, the number of records displayed is equal to the number of records in the base table.
SELECT * from a left join B on a. ID = B. ID
Table A is A base table, so all records are used. Then, let's look at table B. If records that cannot match Table A through the ID field, NULL is displayed.
SELECT * from a, B where a. ID = B. ID (+)
The effect is the same as that of other links to push the self-join: as the name suggests, the table and its own connection Query

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.