日期:2014-05-17 浏览次数:20409 次
TYPE VALUE 节点名称 模块一 NAME 小明 AGE 25
select [节点名称]= case when type='节点名称' then value end , [NAME]= case when type='NAME' then value end , [AGE]= case when type='AGE' then value end from 表
------解决方案--------------------
select [节点名称]= case when type='节点名称' then value end , [NAME]= case when type='NAME' then value end , [AGE]= case when type='AGE' then value end from 表 case when就好了
------解决方案--------------------
select max(case type when '节点名称' then value else 0 end) as 节点名称,
max(case type when 'NAME' then value else 0 end) as NAME,
max(case type when 'AGE' then value else 0 end) as AGE,
from XXX group by xxx