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

来源:互联网 发布:python字典增加元素 编辑:程序博客网 时间:2024/05/21 06:41

如题:



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



0 0
原创粉丝点击