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
,