插入语法从excel导入数据时出错



我需要一些关于一个简短查询的帮助我在编写一个查询时遇到了一些问题,该查询是为了根据excel表上的数据更新表,但一直遇到语法错误

INSERT INTO  [Fleet Commit] ([Commit Type], [Sales Column], [Column1], No, Gender, Style, [Style Descr], Short, [Product Line], Color, Team, [Team Code], Color2, [Logo 1], [Place 1], [Logo 2], [Place 2], [Logo 3], [Place 3], [Logo 4], [Place 4], [Size Scale], [Case Ratio], [Case Ratio Total], [Different Case Ratio], [Approved Whsl], [Suggested Retail], [Customer Whsl], [Customer Retail], [Master Packed? (Y)], [UPC by Size (S) or Carton (C)?], [Solid SKU (S)/ Ratio (R )], [Total Units], [Case Qty], [Total $$], [SAMPLE QTY], [SAMPLE SIZE], [IMAGE REQUEST Y/N], [Licensing Samples])
FROM (SELECT [Commit Type], [Sales Column], [Column1], No, Gender, Style, [Style Descr], Short, [Product Line], Color, Team, [Team Code], Color2, [Logo 1], [Place 1], [Logo 2], [Place 2], [Logo 3], [Place 3], [Logo 4], [Place 4], [Size Scale], [Case Ratio], [Case Ratio Total], [Different Case Ratio], [Approved Whsl], [Suggested Retail], [Customer Whsl], [Customer Retail], [Master Packed? (Y)], [UPC by Size (S) or Carton (C)?], [Solid SKU (S)/ Ratio (R )], [Total Units], [Case Qty], [Total $$], [SAMPLE QTY], [SAMPLE SIZE], [IMAGE REQUEST Y/N], [Licensing Samples]
FROM [Fleet Commit]
IN SCDesktopRetail SA Fall 19 Master Commit Document - 12062018Retail SA Fall 19 Master Commit Document - 12062018.xlsx" "EXCEL 5.0;"
GROUP BY  [Commit Type], [Sales Column], [Column1], [No], Gender, Style, [Style Descr], Short, [Product Line], Color, Team, [Team Code], Color2, [Logo 1], [Place 1], [Logo 2], [Place 2], [Logo 3], [Place 3], [Logo 4], [Place 4], [Size Scale], [Case Ratio], [Case Ratio Total], [Different Case Ratio], [Approved Whsl], [Suggested Retail], [Customer Whsl], [Customer Retail], [Master Packed? (Y)], [UPC by Size (S) or Carton (C)?], [Solid SKU (S)/ Ratio (R )], [Total Units], [Case Qty], [Total $$], [SAMPLE QTY], [SAMPLE SIZE], [IMAGE REQUEST Y/N], [Licensing Samples]
ORDER BY  Style);

我认为您的错误在这一行:

IN SCDesktopRetail SA Fall 19 Master Commit Document - 12062018Retail SA Fall 19 Master Commit Document - 12062018.xlsx"

您还应该删除第一个FROM子句,它不是INSERT INTO命令的一部分,以及ORDER BY

INSERT INTO [Fleet Commit] ([Commit Type], [Sales Column], [Column1], No, Gender, Style, [Style Descr], Short, [Product Line], Color, Team, [Team Code], Color2, [Logo 1], [Place 1], [Logo 2], [Place 2], [Logo 3], [Place 3], [Logo 4], [Place 4], [Size Scale], [Case Ratio], [Case Ratio Total], [Different Case Ratio], [Approved Whsl], [Suggested Retail], [Customer Whsl], [Customer Retail], [Master Packed? (Y)], [UPC by Size (S) or Carton (C)?], [Solid SKU (S)/ Ratio (R )], [Total Units], [Case Qty], [Total $$], [SAMPLE QTY], [SAMPLE SIZE], [IMAGE REQUEST Y/N], [Licensing Samples])
SELECT [Commit Type], [Sales Column], [Column1], No, Gender, Style, [Style Descr], Short, [Product Line], Color, Team, [Team Code], Color2, [Logo 1], [Place 1], [Logo 2], [Place 2], [Logo 3], [Place 3], [Logo 4], [Place 4], [Size Scale], [Case Ratio], [Case Ratio Total], [Different Case Ratio], [Approved Whsl], [Suggested Retail], [Customer Whsl], [Customer Retail], [Master Packed? (Y)], [UPC by Size (S) or Carton (C)?], [Solid SKU (S)/ Ratio (R )], [Total Units], [Case Qty], [Total $$], [SAMPLE QTY], [SAMPLE SIZE], [IMAGE REQUEST Y/N], [Licensing Samples]
FROM [Excel 5.0;HDR=Yes;Database=you file path here].[Sheet1$]
GROUP BY  [Commit Type], [Sales Column], [Column1], [No], Gender, Style, [Style Descr], Short, [Product Line], Color, Team, [Team Code], Color2, [Logo 1], [Place 1], [Logo 2], [Place 2], [Logo 3], [Place 3], [Logo 4], [Place 4], [Size Scale], [Case Ratio], [Case Ratio Total], [Different Case Ratio], [Approved Whsl], [Suggested Retail], [Customer Whsl], [Customer Retail], [Master Packed? (Y)], [UPC by Size (S) or Carton (C)?], [Solid SKU (S)/ Ratio (R )], [Total Units], [Case Qty], [Total $$], [SAMPLE QTY], [SAMPLE SIZE], [IMAGE REQUEST Y/N], [Licensing Samples];

最新更新