I have a table like this tblData (month int,Qty int)
and i am inserting three rows in this table
1.tblData Values (1,100)
2.tblData Values (2,200)
3.tblData Values (3,300)
The Result I want is the Running total of the field Qty
that is 1 100 100
2 200 300
3 300 600
What is the Query for that ?
Answer Posted / anurag misra
select a.month,a.Qty,sum(b.Qty) as total
from tblData a cross join tblData b
where b.month<=a.month
group by a.month,a.Qty
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Is mysql a database?
How can I connect mysql database?
How to show table names with 'mysqlshow'?
What is dump in mysql?
How are mysql timestamps seen to a user?
What is the use of mysql_fetch_array () function in php?
What is mysql57?
Why do we write stored procedures?
Is mysql same as sql?
What is datadir?
How do I connect to mysql database?
Does uninstalling mysql delete database?
What is InnoDB?
Is Mysql query is case sensitive?
How to create table with same structure of student table in mysql?