2个回答
展开全部
select
Sum(case when name='A' then age else null end) as Aage,
Sum(case when name='A' then sex else null end) as Asex,
Sum(case when name='A' then kg else null end) as Akg,
Sum(case when name='B' then age else null end) as Bage,
Sum(case when name='B' then sex else null end) as Bsex,
Sum(case when name='B' then kg else null end) as Bkg,
Sum(case when name='C' then age else null end) as Cage,
Sum(case when name='C' then sex else null end) as Csex,
Sum(case when name='C' then kg else null end) as Ckg
from Student
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询