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 I run mysql?
How much does mysql enterprise cost?
Why mongodb is faster than mysql?
What is myisamchk?
How can I create a database in mysql?
what is database black box testing? : Mysql dba
What is the password of mysql?
Why phpmyadmin is used for mysql?
How Switch (select or use) to a database.
How do I rename a procedure?
How to include comments in sql statements?
Does mysql use sql?
How you can create a trigger in mysql?
What are the advantages and disadvantages of using mysql?
Is postgresql better than mysql?