I am having 3 tables in my MySQL DB. The Tables and columns are like in sample below
Table User
id, name, dob, gross_salary
----------------------------------
1, test1, 12 Mar 90, 50000
2, test2, 10 Jan 85, 45000
Table Wage
ida, date, allowence_paid
------------------------------
1, 10 Jul 13, 12000
2, 10 Aug 13, 23000
2, 12 Aug 13, 1000
1, 15 Aug 13, 15000
Table Loan
id, date, loan_amount
--------------------------
2, 05 Jul 13, 500
1, 05 Aug 13, 2500
1, 06 Aug 13, 1200
I need these three tables merged in results for Aug 13 like
id, name, allowence_paid, loan_Amount, paid
--------------------------------------------
1, test1, 15000, 3700, 11300
2, test2, 24000, 0, 24000
SUM of two columns from two different tables joined to another table is required in my case.
Can I get help for the query? I have experimented as per MySQL JOIN with SUM and 3 tables and failed.