I have two table & Need sum of column from both table, i try but cant get result
My inner join query was:
SELECT loan_collection.coll_date,
sum(loan_collection.coloan_amo) AS coloan_amo,
sum(loan_collection.sc_coll) AS sc_coll,
sum(loan_collection.total_coll) AS total_coll,
loan_collection.year,
bag_del_rentcoll.rent_bagdel,
bag_del_rentcoll.rent_amo,
bag_del_rentcoll.booking,
bag_del_rentcoll.rent_rece
FROM loan_collection AS loan_collection
INNER JOIN
(SELECT del_date,
sum(rent_bagdel) AS rent_bagdel,
sum(rent_amo) AS rent_amo,
sum(booking) AS booking,
sum(rent_rece) AS rent_rece
FROM bag_del_rentcoll) AS bag_del_rentcoll
GROUP BY loan_collection.coll_date
The result is:
as you can see it's sum of all from table two. How can i get result as
Thanks.



ONclause in your query.