e媒网络

一切皆可能 e媒网络 http://www.eMay.net

博客园 首页 新随笔 联系 订阅 管理

第一步:

设计表格MaxMin,结构如下:

里面填满了测试数据:

第二步:

写测试代码:

select PlayerSID,
max(case RaterName when 'pw01' then MaxSign1+MinSign1+MaxSign2+MinSign2  else '' end) as 'pw01',
max(case RaterName when 'pw02' then MaxSign1+MinSign1+MaxSign2+MinSign2  else '' end) as 'pw02',
max(case RaterName when 'pw03' then MaxSign1+MinSign1+MaxSign2+MinSign2  else '' end) as 'pw03',
max(case RaterName when 'pw04' then MaxSign1+MinSign1+MaxSign2+MinSign2  else '' end) as 'pw04',
max(case RaterName when 'pw05' then MaxSign1+MinSign1+MaxSign2+MinSign2  else '' end) as 'pw05'
FROM  MaxMin
group by PlayerSID

最新效果:

技术切记:

表格数据初始为Null时,会出现异常。初始化,为空时,初始化为空字符串 ''

posted on 2020-06-30 18:17  e媒网络技术团队  阅读(176)  评论(0编辑  收藏  举报