select a.student as 学生名,max(a.数学) as 数学 ,max(a.语文) as 语文 from (select student ,' ' as 数学,scores as 语文 from 表A where type = '语文'unionselect student ,scores as 数学 ,' ' as 语文 from 表A where type = '数学') agroup by a.student