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 select query in mysql?
How important is to list the column names when doing an insert?
How do I create a new database in mysql?
How do I export mysql query results to excel?
How to create a new table by selecting rows from another table in mysql?
What is the use of procedure in mysql?
How can you filter the duplicate data while retrieving records from the table?
Is mysql port 3306 tcp or udp?
What is the datatype of image in mysql?
How do I copy a table in mysql?
Write a query to stop mysql in unix
How do I clear the command in mysql?
What is the data type for file in mysql?
How large can a mysql table be?
How do you rename a procedure in mysql?