1、oracle :max+decode 竖表改横表
展示为
select a.project_id,
max(decode(a.vote_result, '01', a.zaiyi, 0)) as v1,
max(decode(a.vote_result, '02', a.zaiyi, 0)) as v2,
max(decode(a.vote_result, '03', a.zaiyi, 0)) as v3
from 表 a
group by a.project_id
2、补充:decode()函数说明
decode(条件字段,条件值,返回值,返回值)