摘要: 基本语法:SELECT ,[第一个透视的列] AS ,[第二个透视的列] AS ,...[最后一个透视的列] AS ,FROM()AS PIVOT(()FOR[]IN ( [第一个透视的列], [第二个透视的列],... [最后一个透视的列])) AS ;例子:create table T3 (Year Nvarchar(10),Mounth Nvarchar(10),Day Nvarchar(10))insert into T3 values ('1991','3','1.3')insert into T3 values ('1991& 阅读全文
posted @ 2013-09-12 01:14 cheng序员 阅读(444) 评论(0) 推荐(0) 编辑
摘要: 描述:现在有两张表,T1由Key和Value两个字段,T2也有Key和Value两个字段当T1中的Key在T2表中存在时,更新使用T2表中对用的Value 值替换T1中的VAlueupdate A set A.Value = B.Valuefrom T1 as Ajoin T2 as B on A.Key = B.key 阅读全文
posted @ 2013-09-12 00:47 cheng序员 阅读(253) 评论(0) 推荐(0) 编辑