Simple =, join, left out join, right Outer Join, cross join

Source: Internet
Author: User
A. =
Eg.
Select a. a B. B from a, B where a. A = B. A and A. C = 'herengang ';
Under this condition, it only shows the data that a. A = B. A and A. C = "herengang ".
Although it there is data which. C is "herengang", but if we can't find such record which. A value equals to. A in Table B, then it will be cleared.
B. Left join
Select a. a, B.
From Table
Left join Table B
On a. A = B. A and A. C = "herengang"
Under this condition, all of data which. C is "herengang" will be retrieved, and then if B. A exists, then show the value of B..

E. g Table A Table B
Columna columnb columnc
1 3 A 1 'OK' 23.3
2 4 B 3 'sorry' 3.0

A join B (a inner B), result is
1 3 A 1 'OK' 23.3
A left join B, result is
1 3 A 1 'OK' 23.3
2 4 B null
A cross join B
1 3 A 1 'OK' 23.3
1 3 A 3 'sorry' 3.0
2 4 B 1 'OK' 23.3
2 4 B 3 'sorry' 3.0

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.