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 / sandhirasegaran
SELECT tbl1.month,tbl1.Qty,( SELECT SUM(tbl2.Qty) FROM
tblData AS tbl2 WHERE tbl1.month >= tbl2.month ) FROM
tblData AS tbl1
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
How do you stop an access query?
List data types in mysql? Explain
What is the usage of "i-am-a-dummy" flag in mysql?
How do I assign a variable in mysql?
What is sql vs mysql?
What is the purpose of using timestamp data type?
How do I grant privileges to a user in mysql phpmyadmin?
What is mysql command line?
How to store binary data in mysql?
What are the advantages of mysql in comparison to oracle?
Does adding an index lock a table?
How will you export tables as an xml file in mysql?
How to execute mysql query in php?
How do I start mysql in mysql workbench?
How many columns can a mysql table have?