#横转列并拼接 select a.name,a.note ,concat(a.pikabing,‘-‘,sum(case when a.type = ‘刺客‘ then a.power end)) as ck ,concat(a.pikabing,‘-‘,sum(case when a.type = ‘战士‘ then a.power end)) as zsFROM zhubiao a where a.`status` = ‘0‘ GROUP BY s.id order by s.class_id