数据库行列转换

来源:互联网 发布:淘宝等级查询 编辑:程序博客网 时间:2024/05/06 23:53




select   name,
sum(case when course='java' then grade end) as java,
sum(case when course='C++' then grade end) as C++,
sum(case when course='C#' then grade end) as C#
from test group by name

转载:http://blog.csdn.net/u014768339/article/details/45912653

0 0