【sql】之case when then else end
时间:2021-07-01 10:21:17
帮助过:4人阅读
a.`name`,
sum((CASE kemu
WHEN ‘语文‘ THEN score
ELSE 0 END))
‘语文‘,
sum((CASE kemu
WHEN ‘数学‘ THEN score
ELSE 0 END))
‘数学‘,
sum((CASE kemu
WHEN ‘英语‘ THEN score
ELSE 0 END))
‘英语‘
from t_score a
GROUP BY a.`name`;
【sql】之case when then else end
标签:.com style blog span logs com from else when