Oracle table Connection unique notation and standard notation

Source: Internet
Author: User

Oracle's Table connection supports standard notation, but there are also Oracle's special wording, which are different in some scenarios, and are recommended for standard notation, which is just an introduction to the standard syntax for table joins and an understanding of Oracle's special wording.

Standard connection Syntax:

Select Table1.column, Table2.column

From table1

[Corss join Table2]

[National Jon Table2]

[Join Table2 using (column)]

[Join Table2 on (Table1.column=table2.column)]

[Left | right | full OUTER join table2 on (Table1.column=table2.column)];


The connection field after the ON keyword is actually used without parentheses can be used normally.


Multiple table connections:

--Connect Table4 and Table5 first and name their result set table2, then connect to table1 Select table1.column,table2.column from table1   inner join  ( select table4.column,table5.column    from  table4 inner join table5    on table4.column =table5.column  )  as table2  on table1.column=table2.column; is equivalent to select table1.column  table2.columnfrom table1 , (select table4.column,table5.column                    from table4,table5                     where table4.column=table5.column)  as table2where table1.column=table2.column;-- Connection Table1,table2,table3, no connection order of Select table1.column,table2.column,table3.column from table1  inner join table2          on  table1.column=table2.column          inner join table3          on table1.column=table3.column; is equivalent to Select table1.column,table2.column, table3.column from table1,table2.table3where table1.column=table2.column and   Table1.column=table3.column;


Internal connection:

Standard notation:

Select Table.column, table2.column from table1 inner join table2 on (table1.column=table2.column);

Oracle Special wording:

Select Table.column, Table2.columnfrom table1, Table2where table1.column=table2.column;


Left JOIN connection:

Standard notation:

Select Table.column, table2.column from table1 left join table2 on (table1.column=table2.column);

Oracle Special wording:

Select Table.column, table2.column from table1, table2where table1.column=table2.column (+);


Right connection:

Standard notation:

Select Table.column, table2.column from table1 right join table2 on (table1.column=table2.column);

Oracle Special wording:

Select Table.column, table2.column from table1, table2where table1.column (+) =table2.column;


Full connection:

Standard notation:

Select Table.column, table2.column from table1 full join table2 on (table1.column=table2.column);

Oracle Special wording:

Select Table.column, table2.column from table1, table2where table1.column (+) =table2.column (+);


This article is from the "Dark Shun" blog, please make sure to keep this source http://mjal01.blog.51cto.com/12140495/1975625

Oracle table Connection unique notation and standard notation

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.