sql列转横并拼接字符串

#横转列并拼接
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
原文地址:https://www.cnblogs.com/mjtabu/p/12990358.html