try this actually i have not tested it but you will get logic.
select A.month ,
(select B.amount where B.monthid=A.monthid and B.head='DA') as 'DA',
(select B.amount where B.monthid=A.monthid and B.head='TA') as 'TA',
(select B.amount where B.monthid=A.monthid and B.head='HRA') as 'HRA'
from tablename A
inner join tablename B on
A.monthid= b.monthid