Multi-field connection between oracle tables

Source: Internet
Author: User

The problem of multi-field connection between oracle tables is as follows:

SELECT * FROM table1 a, table2 B, WHERE a.1 = B .1 AND a.2 = B .2 AND a.3 = B .3 ----------

 

In the initial stage, Table a contains the three fields in Table B that are empty and want to join B with the three fields in table.
Method 1: select * from table1 left outer join table2on a.1 = B .1 and a.2 = B .2 and a.3 = B .3 Method 2: <! -- StartFragment --> SELECT. * FROM table1 a, table2 B, WHERE a.1 = B .1 (+) AND a.2 = B .2 (+) AND a.3 = B .3 (+) method 3: <! -- StartFragment --> a.1 | a.2 | a.3 as the primary key

 

B also handles the same, and then connects to the external
SELECT. * FROM (select a.1 | a.2 | a.3 al from table1) a, (select B .1 | B .2 | B .3 bl from table2) B, WHERE. al = B. bl (+)

 

Related Article

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.