Re: finding the better way to calculate po balance !
OK, let's try with a temp table...
CREATE TEMPORARY TABLE p
SELECT id, SUM(Quantity) AS poqty FROM po WHERE active GROUP BY id;
ALTER TABLE p ADD PRIMARY KEY(id);
SELECT p.id, p,poqty, i.outqty
FROM p
JOIN ( SELECT poid, SUM(qty) AS outqty FROM invoicedetail WHERE active GROUP BY poid ) AS i
ON p.id = i.poid
WHERE p.poqty > i.outqty;
Subject
Views
Written By
Posted
2088
June 16, 2011 04:39AM
935
June 17, 2011 09:57AM
1023
June 17, 2011 11:00AM
Re: finding the better way to calculate po balance !
958
June 17, 2011 10:41PM
1098
June 18, 2011 08:56AM
643
June 18, 2011 09:50AM
864
June 18, 2011 10:36AM
907
June 18, 2011 03:02PM
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.