The combination of Inner Join and Left Join and condition, innerjoin

Source: Internet
Author: User

The combination of Inner Join and Left Join and condition, innerjoin

When using relational databases, table join and filtering of result sets are essential query skills. Do you understand their usage? Let's try again.

Table creation and initialization:

Inner Join result set:

 

 

For Inner Join, conditions have the same effect in on or where.

 

 Left Join result set:

 

 The Left Join condition is in the On clause and is a base table.ConditionIt can be seen that it does not affect the master table. It is used to find the records that meet the conditions in the master table and then Join with the slave table.

 

The Left Join condition is in the On clause and is from the table.Condition, Still does not affect the master table, find the result set that meets the slave table Conditions

 

In the Where clause, the Left Join condition filters the result set after Left Join, which is relatively simple.

 

These are common usage and may be far from the expected results.

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.