如何在Jet SQL INSERT INTO子句中实现变量

时间:2013-05-29 14:52:20

标签: sql insert jet insert-into

MS Access Jet SQL中是否有方法实现替换变量,以便执行者可以输入自己的新表名?请参见下面的SQL:

SELECT 
  Subset.FacNo, 
  Subset.BldgNum, 
  Subset.Qrate AS Qrate, 
  Subset.MaxOfSqFt AS SqFeet, 
  Subset.Frate AS Frate 
INTO [Enter Table Name]
FROM (
  SELECT 
    FacNo, 
    Qrate, 
    Frate, 
    MAX(SqFeet) AS MaxOfSqFt, 
    Replace(LTrim(Replace([FacNo],"0"," "))," ","0") AS BldgNum 
  FROM ISR_Q3_2013_webdata 
  GROUP BY 
    FACNO, 
    Qrate, 
    Frate
 )  AS Subset;

感谢您提出任何建议。

0 个答案:

没有答案