In message <1281433431.2036.2.ca...@mick-laptop>, Mick Sulley
<m...@sulley.info> writes
>Thanks John,
>
>I found a website that explains what I wanted to do -
>http://www.databasejournal.com/features/mssql/article.php/3112381/SQL-Server-
>Calculating-Running-Totals-Subtotals-and-Grand-Total-Without-a-Cursor.htm
>
>I had never heard of rollup, it look really interesting, I will try it
>out and see what I can do with it.
>
>Cheers
>Mick
>
>On Mon, 2010-08-09 at 19:46 -0700, John Magee wrote:
>> 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

I am not clear how to use rollup in this case.  I have used rollup to
get totals, or subtotals
a       3
b       3
c       2
(rollup)8

but not the way that the OP asked - I understood that he wanted 
a       3       3
b       3       6
c       2       8

Can you use rollup for that?

-- 
Pete Clark

Local sites for Local People in Spain
http://localFaces.net

Reply via email to