日期:2014-05-17  浏览次数:20384 次

把行转成列怎么操作?
怎么把这个表

查询成这个样子?

------解决方案--------------------

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