MySQL Forums
Forum List  »  InnoDB

SUM for Multiple Table and Child Table
Posted by: Rahmat Priyanto
Date: July 04, 2013 05:47PM

Please help me,

I need to create JOIN syntax for this query :

SELECT TblSupplier.SupplierName AS SupplierName, (SUM(TblBuy.TotalBuy) - SUM(TblReturn.TotalReturn)) AS Total, (SUM(TblPayment.TotalPaymentToday) - SUM(TblReturnItem.TotalReturnToday)) AS TotalPayment, ((SUM(TblBuy.TotalBuy) - SUM(TblReturn.TotalReturn)) - (SUM(TblPayment.TotalPaymentToday) - SUM(TblReturnItem.TotalReturnToday))) AS Balance FROM ... GROUP BY TblSupplier.ID

but I don't know how to do it...

thank you

http://postimg.org/image/628twkeel/
(please see image for more detail)



Edited 6 time(s). Last edit at 07/04/2013 06:18PM by Rahmat Priyanto.

Options: ReplyQuote


Subject
Views
Written By
Posted
SUM for Multiple Table and Child Table
1316
July 04, 2013 05:47PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.