I have two tableEmployee table Employeeid Name Department 1 AA IT 2 AB SALES 3 AA IT Employee Salary Employeeid Paydate Mode Amount 00001 2011-01-15 Cash 5000 00001 2011-05-15 Cash 5000 00003 2011-02-15 Cash 5000 00003 2011-02-15 Cheque 6000 i need the following out put Employeeid Amount 10001 10,000 10002 000000 10003 11,000