Quantcast
Channel: MySQL Forums - InnoDB
Viewing all articles
Browse latest Browse all 1954

SUM for Multiple Table and Child Table (1 reply)

$
0
0
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)

Viewing all articles
Browse latest Browse all 1954

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>