hi,
I have table where I need to select MAX(SUM(total)) of a periods total.
SELECT SUM(P.amount) as total FROM bank P WHERE P.ReceivedDate >= '2008-07-28' AND P.ReceivedDate <= '2008-08-31';
SELECT SUM(P.amount) as total FROM bank P WHERE P.ReceivedDate >= '2008-09-01' AND P.ReceivedDate <= '2008-09-28';
SELECT SUM(P.amount) as total FROM bank P WHERE P.ReceivedDate >= '2008-09-29' AND P.ReceivedDate <= '2008-10-26';
I have run the above queries and find the Highest total in php.
I am not sure how to group by this query.
I am expecting a single query to replace all this query to MAX(SUM(total)).
please help me out.