English 中文(简体)
如何将轴表保存为永久表
原标题:How to save pivot table as permanent table

我在MS Sql Server 2008 中创建了一条支流表。 我怎样才能将由此形成的支流表保存到永久的桌子上?

SELECT *
FROM (SELECT yr as [year], lname as [player], avg_rating as Rating
  FROM pool_ratings_yr1) as s
PIVOT
  (SUM(Rating) FOR [player] in (greenleaf, maturo, allen, caras, concannon, taberski, mosconi, weston, seaback, deoro, blankenship, ralph, keough, kreuter, layton, hueston, rudolph, lauri) ) AS pool_pivot

Thanks, Will

最佳回答

使用 < a href=>" "http://msdn.microsoft.com/en-us/library/ms188029%28SQL.100%29.aspx" rel="nofollow"\\code>SELECT into :

SELECT *
INTO dbo.Permanent_Table_1
FROM 
(
  SELECT yr as [year], lname as [player], avg_rating as Rating
  FROM dbo.pool_ratings_yr1
) as s
PIVOT
(
   SUM(Rating) FOR [player] in (greenleaf, maturo, allen, caras, 
      concannon, taberski, mosconi, weston, seaback, deoro, blankenship, 
      ralph, keough, kreuter, layton, hueston, rudolph, lauri) 
) AS pool_pivot;
问题回答

暂无回答




相关问题
Performance impact of indexed view in MS SQL Server 2008

Does anyone have experience with using indexed view in MS SQL Server 2008? I am trying to find out how does indexed view affect performance of insert / update statements, that are adding / updating ...

Lock Escalation - What s happening here?

While altering a table (removing a column) in SQL Server 2008, I clicked the Generate Change Script button and I noticed that the change script it generated drops the column, says "go" and then runs ...

Round to nearest 5 in SQL Server

I have a Money column in my SQL Server 2008 table. In my below query how can I round it to nearest 5$ select FineAmount from tickets Thanks

热门标签