Internal joins of databases, outer joins __ database

Source: Internet
Author: User
Tags joins
database of internal and external links reproduced Web site: http://www.cnblogs.com/younes/archive/2010/07/12/1776046.html

There are now two tables: Customers and Orders

Customer table,

Orders table,

Normal query,

Left outer join query,

Right outer join query,

Inner JOIN query,

Description

1 The normal Query method is the default for the inner join.

2 The INNER JOIN query displays only two columns of the query criteria that exist in two tables. If the query condition is customers.cust_id = orders.cust_id, the ID 2002 of a customer exists only in the Customers table and not in the Orders table. So do not show.

3 outer join query, when using the outer join syntax, you must use the right or left keyword, which points to left table as the base table, and vice versa. The Left keyword indicates that as long as cust_id appears in the left-hand table, the result must contain this cust_id, even if the cust_id does not appear in the right table.

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.