关于SQL Server中的SELECT INTO
以下引发错误Incorrect syntax near ')'.
SELECT * INTO Sales.MyTable FROM
(SELECT TOP(100) * FROM Sales.Customer)
以下内容将通过
With tempCust AS
(
SELECT TOP(100) * FROM Sales.Customer
)
SELECT * INTO Sales.MyTable FROM tempCust
背后的规则是什么?
答案 0 :(得分:6)
您可以向alias
添加subquery
,如下所示,然后尝试一下..
SELECT * INTO Sales.MyTable FROM
(SELECT TOP(100) * FROM Sales.Customer) as abc