Insert into的写法
INSERT INTO dbo.DM_T_RWX_UserProductSerialCodeInfo(userid,ProductSerialCode,count) SELECT TOP 10 userid,productserialcode,SUM([COUNT])AS cnt FROM dbo.DM_RW_UserItemsInfo GROUP BY userid,ProductSerialCode
Sqlserver 2005 PIVOT来进行行列转换,方便很,看了很多往篇文章,这篇是最易懂的
Download details: SQL Server 2005 Samples and Sample Databases
Microsoft SQL Server Product Samples: Database - Release: SQL Server 2005 SP2a