Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is select query in mysql?

858


How important is to list the column names when doing an insert?

991


How do I create a new database in mysql?

857


How do I export mysql query results to excel?

917


How to create a new table by selecting rows from another table in mysql?

922


What is the use of procedure in mysql?

883


How can you filter the duplicate data while retrieving records from the table?

845


Is mysql port 3306 tcp or udp?

874


What is the datatype of image in mysql?

868


How do I copy a table in mysql?

882


Write a query to stop mysql in unix

994


How do I clear the command in mysql?

891


What is the data type for file in mysql?

923


How large can a mysql table be?

882


How do you rename a procedure in mysql?

895