with tbl as
(
select 'ABC' clgname , 'X' programe , 1 particularid, 5000 f1
union all
select 'ABC' , 'y' , 2 , 2000
union all
select 'ABC', 'Z', 3 , 4000
)
select particularid,
Isnull([x],0) as [X programe],[y] as [Y programe],[z] as [Z programe]
from tbl
pivot (sum(f1) for programe in ([x],[y],[z]))as pvt_tbl
Happy Coding!
:)