怎么样才能实现如下效果:
电子类电压 电子类容量 电子类长度 电子类别颜色 建材类电压 建材类容量
1000 1000 (Null) Null Null Null
建材类长度 建材类颜色 日用类电压 日用类容量 日用类长度 日用类颜色
10 Null Null Null Null 红色
select max(case 类别 when '电子类' then 电压 end) as 电子类电压
,max(case 类别 when '电子类' then 长度 end) as 电子类长度
,max(case 类别 when '电子类' then 颜色 end) as 电子类颜色
,max(case 类别 when '电子类' then 容量 end) as 电子类容量
,max(case 类别 when '建材类' then 电压 end) as 建材类电压
,max(case 类别 when '建材类' then 长度 end) as 建材类长度
,max(case 类别 when '建材类' then 颜色 end) as 建材类颜色
,max(case 类别 when '建材类' then 容量 end) as 建材类容量
,max(case 类别 when '日用类' then 电压 end) as 日用类电压
,max(case 类别 when '日用类' then 长度 end) as 日用类长度
,max(case 类别 when '日用类' then 颜色 end) as 日用类颜色
,max(case 类别 when '日用类' then 容量 end) as 日用类容量
from(
select a.类别,b.电压,b.长度,b.颜色,b.容量 from Q_Category a,Item b
where a.PKID=b.类别PKID
) aa