$ 0 0 try, select id, name, max(case when subjkect ='Maths' then msk else null end), max(case when subjkect ='Science' then msk else null end), max(case when subjkect ='english' then msk else null end) from table group by 1,2
try,
select id, name,
max(case when subjkect ='Maths' then msk else null end),
max(case when subjkect ='Science' then msk else null end),
max(case when subjkect ='english' then msk else null end)
from table
group by 1,2