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
What is the query to display top 20 rows?
What are procedures in mysql?
Which is better mysql or mssql?
How to create a new table by selecting rows from another table in mysql?
How set mysql root password?
What are the purposes of using enum and set data types?
In mysql, what is joins? Explain
What is mysql command line?
What is the difference between database and table?
What is datatype in mysql?
What is federated tables in mysql?
Where the database is stored in mysql?
What is the latest mysql?
Is mysql free download?
How to delete an existing column in a table?