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 / anurag misra

select a.month,a.Qty,sum(b.Qty) as total
from tblData a cross join tblData b
where b.month<=a.month
group by a.month,a.Qty

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to dump all databases for backup. Backup file is sql commands to recreate all db's.

929


What is the usage of regular expressions in mysql?

902


can you tell the order of sql select statement? : Mysql dba

915


Is there a free version of mysql?

946


How to delete a column and add a new column to database

948


What is the password of mysql?

970


How do I download mysql on my laptop?

894


Where is mysql password stored?

937


Write a query to fetch duplicate records from a table using mysql?

942


How to display nth highest salary from a table in a mysql query?

997


Where is mysql used?

1001


What is username in mysql?

902


What is the latest version of php and mysql?

1220


How do you rename a procedure in mysql?

953


What you can use regular expression for in mysql? Support your answer with an example?

926