mysql查询 按时间列区分不同列

数据库格式

图片说明

想到得到的结果:

图片说明

select
max(case when 时间 = 2019 then a else null end) '2019a',
max(case when 时间 = 2019 then b else null end) '2019b',
max(case when 时间 = 2019 then c else null end) '2019c',
。。。
from tbl

分组查询得出的结果建立临时表。