score表
stuid subject score
1 math 80
1 english 90
2 math 81
2 english 91
3 math 85
3 english 95
要求得到的组合查询结果
id math english sum
1 80 90 170
2 81 91 172
3 85 95 180
avg 82 92 174
(
SELECT
stuid as id,
CAST(sum(case when `subject`='math' then score end) AS SIGNED) as math,
CAST(sum(