try this ..
SELECT sum( amt ) FROM emp WHERE empid =1 group by scode
hope it will help
update query...
SELECT distinct (select sum(amt) FROM emp where empid='1' and scode ='e' ) as totalearnings,
distinct (select sum(amount) from emp where empid='1' and scode ='d') as totaldeductions
FROM emp;