惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

The GitHub Blog
The GitHub Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
Y
Y Combinator Blog
B
Blog RSS Feed
K
Kaspersky official blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Know Your Adversary
Know Your Adversary
C
CERT Recently Published Vulnerability Notes
V
Vulnerabilities – Threatpost
C
Check Point Blog
L
LINUX DO - 热门话题
Simon Willison's Weblog
Simon Willison's Weblog
Spread Privacy
Spread Privacy
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
The Hacker News
The Hacker News
P
Palo Alto Networks Blog
L
Lohrmann on Cybersecurity
T
Tor Project blog
T
Tenable Blog
H
Help Net Security
人人都是产品经理
人人都是产品经理
WordPress大学
WordPress大学
Cisco Talos Blog
Cisco Talos Blog
T
Threatpost
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
S
Schneier on Security
G
Google Developers Blog
P
Privacy & Cybersecurity Law Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
小众软件
小众软件
aimingoo的专栏
aimingoo的专栏
Microsoft Azure Blog
Microsoft Azure Blog
Cyberwarzone
Cyberwarzone
Security Latest
Security Latest
AWS News Blog
AWS News Blog
P
Proofpoint News Feed
美团技术团队
博客园 - 三生石上(FineUI控件)
Latest news
Latest news
腾讯CDC
G
GRAHAM CLULEY
阮一峰的网络日志
阮一峰的网络日志
博客园 - 叶小钗
博客园 - 【当耐特】
C
CXSECURITY Database RSS Feed - CXSecurity.com
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
T
Threat Research - Cisco Blogs
T
The Exploit Database - CXSecurity.com
Martin Fowler
Martin Fowler

博客园 - kuning的程序博客

第一章 第二课 Using Resources 第一章 第一课 Using WPF Control Cmd,powershell 参考 百度WSUS 我也转关于软件测试的文章 了解WMI 英文面试题 据说是微软面试哦 算法 之 万年历 算法 之 哥德巴赫猜想 - kuning的程序博客 C# 理论学习 之 面向对象设计 C# 理论学习 之 类、组,名称空间 C# 深入学习 之 Winform记录日志 C#深入学习 之 委托和事件 C#数据结构-排序之快速排序法 .Net本地化资源 PHP之安装篇 再叙2005Web控件(一) - kuning的程序博客 - 博客园 Poket PC 与 sqlserver2000(以上) RDA 方案
Sql Server中的行列互换
kuning的程序博客 · 2007-09-03 · via 博客园 - kuning的程序博客

在Oracle中行列互换可以通过decode来实现,SqlServer中我们也有相应的措施;case
下面是一个列子

 1 --建表
 2 Create   table   test   ( [name] char(10), km char(10)   , cj int )
 3 Go
 4 --初始化数据
 5 insert   into   test   values('张三','语文',80)
 6 insert   into   test   values('张三','数学',86)
 7 insert   into   test   values('张三','英语',75)
 8 insert   into   test   values('李四','语文',78)
 9 insert   into   test   values('李四','数学',85)
10 insert   into   test   values('李四','英语',78)
11 Go
12 --行列互换
13 select name,sum(case km when '语文' then cj  endas 语文,
14 sum(case km when '数学' then cj  endas 数学,
15 sum(case km when '英语' then cj  endas 英语
16 from test
17 group by name