INSERT INTO Pricing_Compare (SKU, ScansourcePrice, BluestarPrice, BarcodePrice, Manufacturer, Product)
SELECT
Product.SKU, Product.Name, ProductVariant.Price,
Manufacturer.Name,Scansource.COST, Bluestar.PRICE
FROM
Product
INNER JOIN
ProductVariant ON Product.ProductID = ProductVariant.ProductID
INNER JOIN
ProductManufacturer ON Product.ProductID = ProductManufacturer.ProductID
INNER JOIN
Manufacturer ON ProductManufacturer.ManufacturerID = Manufacturer.ManufacturerID
INNER JOIN
Scansource ON Product.SKU =Scansource.SKU
INNER JOIN
Bluestar ON Product.SKU = Bluestar.MFG_PART_NUMBER
我受到0行的影响。这似乎是直截了当的。无法理解。
答案 0 :(得分:0)
试试这个。我在select
查询中重新排列了列名。
INSERT INTO Pricing_Compare (SKU,ScansourcePrice,BluestarPrice,BarcodePrice,Manufacturer,Product)
SELECT Product.SKU,Scansource.COST, Bluestar.PRICE, ProductVariant.Price Manufacturer.Name,Product.Name
FROM Product
INNER JOIN ProductVariant ON Product.ProductID = ProductVariant.ProductID
INNER JOIN ProductManufacturer ON Product.ProductID = ProductManufacturer.ProductID
INNER JOIN Manufacturer ON ProductManufacturer.ManufacturerID = Manufacturer.ManufacturerID
INNER JOIN Scansource ON Product.SKU =Scansource.SKU
INNER JOIN Bluestar ON Product.SKU = Bluestar.MFG_PART_NUMBER