数据库一列多行转一行多列

时间:2014-05-23 02:36:41   收藏:0   阅读:477

如题:

bubuko.com,布布扣



select
max(case when name=‘1‘ then [temp] else null end) as temp1
, max(case when name=‘2‘ then [temp] else null end) as temp2,
 max(case when name=‘3‘ then [temp] else null end) as temp3
from historyt group by time


bubuko.com,布布扣

数据库一列多行转一行多列,布布扣,bubuko.com

原文:http://blog.csdn.net/zhao50632/article/details/26579837

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!