Database left connection, right connection, inner connection

Source: Internet
Author: User

Left JOIN connect   left join or LEFT outer joinsql statement: SELECT * FROM student left join course on Student.id=course. The ID left OUTER JOIN contains all rows from the left table in the left join, and if there is no match in the right table for a row in the table, the portion of the right table in the corresponding row in the result is all empty (null) .   right connects   right join or correct outer Joinsql statement: SELECT * FROM student right joins course on Student.id=course. The ID right outer join contains all the rows in the right table of the correct join, and if a row in the left table does not match on the right table, the portion of the result corresponding to the left table is all empty (null).    fully outer join   full join or FULL outer joinsql statement: SELECT * FROM student complete join course on Student.id=course. The ID full outer join contains all the rows in both the left and right tables of the complete join, and if there is no match in the left table for a row in the table, the portion of the right table in the corresponding row in the result is all empty (null), and if a row in the left table does not match in the right table, the portion of the left table    internal connection   join or inner joinsql statement: SELECT * FROM student inner JOIN course on student.id=course. Idinner join is a comparison operator that returns only rows that meet the criteria.     use the data after the query as a temporary table SELECT userid from--the number of users who purchased more than 30 in the order form UserId (    select Userid    from orderinfo--OrderInfo Order Form     group by UserId have SUM (Amount ) >30) as t1 

Database left connection, right connection, inner connection

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.