Use FULLOUTERJOIN to splice multiple table data

Source: Internet
Author: User
Therefore, this Report uses INNERJOIN or LeftjoinRightJoin to connect two tables without the expected data. At that time, the idea of the Report developer was to first conform

Therefore, this Report directly uses inner join or Left join/Right Join to connect two tables without the expected data. At that time, the idea of the Report developer was to first conform

Use full outer join to JOIN multiple tables

[Date: 2012-10-19] Source: Linux Author: SmithLiu328 [Font:]

Today, we help you modify a report, and design the warehouse receiving and warehouse receiving operations in it. We need to list the Daily portal information of each product.

This may happen:

1. The product has data in the warehouse receiving table, but there is no data in the warehouse receiving table.

2. There is data in the product warehouse receiving table, but there is no data in the warehouse picking table

Therefore, this Report directly uses inner join or Left join/Right Join to connect two tables without the expected data. At that time, the idea of the Report developer was to first find out qualified products from the warehouse receiving table and warehouse receiving table, and then use left join to connect the warehouse receiving table and warehouse receiving table to obtain the final data. Of course, there is no problem in doing this, but no intermediate table is required. You only need to use full outer join to obtain the required data. (Full outer join is rarely used)

Here is an example:

QTYINT)

QTY

1, 10)

2, 20)

2, 30)

3, 40)

-- Expected final result:

Bon a. ID = B. ID

Bon a. ID = B. ID

Bon a. ID = B. ID

Bon a. ID = B. ID

UNION

Bon a. ID = B. ID

,

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.