我有三个表,我正在尝试从一个表中执行 SELECT 并在具有相同值的三列上使用 ON 插入另一个表。
这就是我尝试的...
INSERT INTO
CustomerDetails_TEST
(Region_ID)
SELECT
RegionStatesUS.Region_ID
LEFT JOIN Customers ON Customers.Customer_ID = CustomerDetails_TEST.Customer_ID
LEFT JOIN RegionStatesUS ON RegionStatesUS.RegionState = Customers.BillingStateOrProv
FROM Customers
WHERE Customers.Customer_ID = CustomerDetails_TEST.Customer_ID
桌子是...
CustomerDetails_TEST
RegionStatesUS
Customers
我正在尝试INSERT
使用RegionStatesUS.Region_ID
.Customer_ID
INTO
CustomerDetails_TEST
Region_ID
我在这里想念什么?