Oracle database, join multi-Table Association, union result set Merge

Source: Internet
Author: User

Join on: Multi-Table Association

Internal connections: Connecting to other tables

From table 1 T  join table 2 s on  t. Field 1 =s. field 2  join table 3 N on N. field 3=t. field 1 or from table 1 A, table 2 B, table 3c  where a. field =b. field

  

Self-connect: connect to itself

From table 1 T  join table 1 s on  t. Field 1 =s. field 1  S. field 1=t. Field 1

Outer connection: Left/Right connection

     the LEFT join   is guaranteed that the data on the left side of the table shows all the    right joins  on the starboard join to ensure that the data on the right table is displayed

  

Full connection: Ensure that the data on both sides of the table appears

Full join on

  

Union: Result set Merge

Requirement: The number of columns and field types of the data should be consistent

Cases:

Select S.name,s.sex,t.cno from student sunionselect t.name,t.sex,t.cno from student t   remove duplicate data and merge Select S.name,s.sex,t.cno from student sunion  allselect t.name,t.sex,t.cno from student t   remove duplicate data and merge

  

Oracle database, join multi-Table Association, union result set Merge

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.