我将第一个表存储在数据库中,如图所示,并且我必须对其应用查询以将其显示为第二个表
6tqwzwtp1#
这里有一个选项 conditional aggregation :
conditional aggregation
select subject, max(case when exam = 'Mid1' then marks end) as Mid1, max(case when exam = 'Mid2' then marks end) as Mid2 from yourtable group by subject
1条答案
按热度按时间6tqwzwtp1#
这里有一个选项
conditional aggregation
: