Sorry, I would like to ask, can such a query be used on a database with a large amount of data? For example, if the query is performed on a data table with 5 million records, will it be very slow?
The specified join must have a relationship and describe
FROM
(
SELECT DISTINCT ModelInfoNO FROM [InStockOrder Details]
union
SELECT DISTINCT ModelInfoNO FROM [OutStockOrder Details]
) A_x
INNER JOIN
(
SELECT DISTINCT InShopWarehouseNO AS ShopWarehouseNO FROM [InStockOrders]
union
SELECT DISTINCT OutShopWarehouseNO FROM [OutStockOrders]
)A_y
Is there a relationship description? ?
I just don't know how to connect the two sets behind FROM, and there is no relationship between the two sets after FROM. I just have to do the following queries based on these two sets.
Is there any other way to achieve my desired function?
The two behind from have nothing to do with each other, they are relatively independent, but the left join on will use them for query conditions. You can look at all the codes above.