MySQL行转列
时间:2021-07-01 10:21:17
帮助过:3人阅读
username,
MAX(
CASE course
WHEN ‘chinese‘ THEN score
ELSE 0 END)
AS ‘语文‘,
MAX(
CASE course
WHEN ‘math‘ THEN score
ELSE 0 END)
AS ‘数学‘,
MAX(
CASE course
WHEN ‘english‘ THEN score
ELSE 0 END)
AS ‘英语‘
FROM score
GROUP BY username
MySQL行转列
标签:png bsp cas rom weight style name ase user