MySQL Forums
Forum List  »  General

Re: SUM function
Posted by: Caroline Danko
Date: February 09, 2005 02:31PM

I am very very sorry!
You are right! there was no difference...

Now I am sending the two statements again:

This one is working fine:
SELECT DISTINCT nav.navperunit, Invest_History.client_acct, customers.subunit, Invest_History.redemption_unit, Invest_History.addition_unit, Invest_History.transfer_unit, format(((customers.subunit - SUM(Invest_History.redemption_unit) + SUM(Invest_History.addition_unit)) * nav.navperunit) ,3) AS TotalPerf
FROM customers, Invest_History, nav
WHERE nav.period = 'colname' AND customers.client_acct = Invest_History.client_acct AND customers.active = 'Y'
GROUP BY Invest_History.client_acct

This one is not:
SELECT DISTINCT nav.navperunit, Invest_History.client_acct, customers.subunit, Invest_History.redemption_unit, Invest_History.addition_unit, Invest_History.transfer_unit, format(SUM((customers.subunit - SUM(Invest_History.redemption_unit) + SUM(Invest_History.addition_unit)) * nav.navperunit) ,3) AS Total
FROM customers, Invest_History, nav
WHERE nav.period = 'colname' AND customers.client_acct = Invest_History.client_acct AND customers.active = 'Y'
GROUP BY nav.period


The only difference is a SUM after "format"

Thank you for catching that up!!!!!!!!

Caroline

Options: ReplyQuote


Subject
Written By
Posted
February 08, 2005 02:11PM
February 08, 2005 04:13PM
Re: SUM function
February 09, 2005 02:31PM
February 10, 2005 10:04AM
February 10, 2005 11:30AM


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.