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 / shaik
select a.month,a.quantity,sum(b.quantity) as total from qunt
a cross join qunt b
where b.month<=a.month
group by a.month,a.quantity
order by month
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How do I uninstall mysql connector?
What is ntext?
How do I stop a mysql command?
What is the difference between char and varchar?
How to Change a users password from MySQL prompt. Login as root. Set the password. Update privs.
Does mysql case matter?
What is memory table?
How to display top 10 rows in mysql?
How do I restore a database in mysql workbench?
What is the difference between procedure and function in mysql?
How to convert character strings to dates?
What is procedure in mysql?
Can a table have multiple primary keys?
What is the maximum size of table in mysql?
How to copy data from one server to another using php?