把行转成列怎么操作?
怎么把这个表
查询成这个样子?
[解决办法]
select name,
max(case when actionname = 'add' then '增加' else null end) 'add',
max(case when actionname = 'del' then '删除' else null end) 'del',
max(case when actionname = 'read' then '读取' else null end) 'read'
from tb
group by name