On Aug 9, 2010, at 2:41 PM, Mick Sulley wrote:

> Hi,
> 
> I have a database with transaction data, transactions are basically cash
> and assets, so cash in/out (positive or negative) and asset purchase or
> sale (positive or negative).
> 
> I would like to display a table showing the transactions and the running
> total.  How can I do that?
> 
> I am not sure whether to try to do it in SQL and just display the result
> using PHP or to use SQL to retrieve the transactions and calculate the
> running total in PHP.
> 
> Any help would be much appreciated
> 
> Thanks
> 
> Mick
You want to do it in mysql - it's just more useful in such a situation.  Do you 
know what roll ups are?

Or do you just want to run one select query that has all the transactions and 
then union it with a query that has the total.

A running total gives a total after every transaction, if that's what you want 
use roll up

Reply via email to