Inner left right join statement

Source: Internet
Author: User


Inner left right join statement SQL code CREATE TABLE 'A' ('a1' VARCHAR (10) DEFAULT NULL, 'b1 'varchar (10) DEFAULT NULL, 'c1' VARCHAR (10) default null) ENGINE = innodb default charset = utf8 www.2cto.com create table 'B' ('a2 'VARCHAR (10) DEFAULT NULL, 'b2' VARCHAR (10) DEFAULT NULL) ENGINE = innodb default charset = utf8: The data in the table is as follows: SQL statement execution result image: SQL code below the statement # inner join SELECT. *, B. * FROM a inner join B ON. a1 = B. a2 www.2cto.com SQL code # left join SELECT. *, B. * FROM a left outer join B ON. a1 = B. a2 SQL code # right join SELECT. *, B. * FROM a right outer join B ON. a1 = B. a2 SQL code # full outer join union SELECT. *, B. * FROM a left outer join B ON. a1 = B. a2 UNION www.2cto.com select. *, B. * FROM a right outer join B ON. a1 = B. a2 SQL code SELECT. *, B. * from a, B SQL code SELECT. *, B. * FROM a JOIN B ON. a1 = B. a2 is inner join by default.

 

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.