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
What is triggers and how it can be used in mysql?
Is mysql free software?
Is number a datatype in mysql?
How to delete a table.
How to delete the repeated records from a table?
What is the current version of mysql?
How can I insert images into a Mysql database?
Can you tell what are various ways to create an index?
How do I connect to a mysql database?
How do I find my mysql username and password?
How would you get the current date in mysql?
Explain what is mysql?
Can varchar be primary key?
Write a program using the select statement, while loop.
What is full form of xampp?