"CL" multi-Table query (inner and outer joins)

Source: Internet
Author: User

Cross join: The result set produced by the connection Cartesian product

A has 7 rows, B has 8 rows A of the first row and each row of B to connect, there is 8 A to the first row

7*8=56 Strips

Select A.real_name,s.unix_host,s.os_username

From account a cross join service s; (56)

Select A.real_name,s.unix_host,s.os_username

From account a cross join service s

where a.id = s.account_id;

INNER JOIN (join or INNER join)

Ps:ijoin is a shorthand for the inner join, the same meaning.

Select A.real_name,s.unix_host,s.os_username

From account a join service s on a.id = s.account_id;

Driver table: From this table when generating the result set the left side is the driver table

Match table:

The outer joins are left-connected (either to the right join or to the outer join), to the connection to the starboard join, or to the outer join, and to the full outer join (either the complete join or the outer join)

Left join table with no restrictions

(There are 7 records on the left, of which there are 4 matches on the right with a total of 8, can not find a match to show an entire bar to the right is empty (a total of 3), found matching) Total 11 records

Right join table with no restrictions

(There are 8 records on the right, 8 and 7 on the left have 1 matches, the total 8

"CL" multi-Table query (inner and outer joins)

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.