select 'A' as E,max(case when E='AA' then a end) as AA,max(case when E='BB' then a end) as BB from tablename
union all
select 'B' as E,max(case when E='AA' then b end) as AA,max(case when E='BB' then b end) as BB from tablename
union all
select 'C' as E,max(case when E='AA' then c end) as AA,max(case when E='BB' then c end) as BB from tablename
union all
select 'D' as E,max(case when E='AA' then d end) as AA,max(case when E='BB' then d end) as BB from tablename
union all
select 'B' as E,max(case when E='AA' then b end) as AA,max(case when E='BB' then b end) as BB from tablename
union all
select 'C' as E,max(case when E='AA' then c end) as AA,max(case when E='BB' then c end) as BB from tablename
union all
select 'D' as E,max(case when E='AA' then d end) as AA,max(case when E='BB' then d end) as BB from tablename
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货