How Oracle tables are connected to tables (internal connection: INNER JOIN, outer join full connection: outer JOIN, LEFT join: Left OUTER JOIN, right connection: R outer JOIN, natural Connection: natural join)

Source: Internet
Author: User

 1-- inner connection: INNER JOIN It represents a matching record that returns two table or Recordset join fields, representing the portion of two tables that are contained in each other 2Select *  from Inner Join On Student.sno=  sc.sno;
  
3 -- outer join (full join): Contains all rows of the left and right two tables, regardless of whether there are rows in the other side of the table that match them. A null value is substituted for a non-conforming condition. 4 -- Full connection: Indicates that two tables are grouped together, and left and right are not matched when replacing 5 select * from student full outer join SC on student.sno= Sc.sno;

6-- left connection: The left outer connection is also called LEFT JOIN, which means to include all records on the left table, all matching records on the right, and if not, fill them with empty. In other words, list the left table all, and the right side of the table to meet the criteria, the non-qualified null value instead. 7 Select * from Left outer Join on Student.sno=sc.sno;

8 --Right connection: The right outer connection is also called the right connection, which means including all the records on the right side table, matching the records on the left table, and if not, empty. In other words, as in left JOIN, list all of the right table, and the left table is eligible, the non-qualified null value substitution.9 Select * fromStudent Right outer JoinSc onStudent.sno=Sc.sno;

Ten --Natural join: Use the Equals (=) operator in the join condition to compare the column values of the connected column, but it uses the selection list to indicate which columns are included in the query result collection and to delete the duplicate columns in the Join table. In fact, as long as the field name is the same, the data type is different, you can do natural connection. One Select * fromStudent NaturalJoinSc

How Oracle tables are connected to tables (internal connection: INNER JOIN, outer join full connection: outer JOIN, LEFT join: Left OUTER JOIN, right connection: R outer JOIN, natural Connection: natural join)

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.