1

我在 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

谢谢,威尔

4

1 回答 1

0

使用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;
于 2012-05-23T02:56:36.773 回答