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

Is mysql a database?

900


How can I connect mysql database?

860


How to show table names with 'mysqlshow'?

983


What is dump in mysql?

842


How are mysql timestamps seen to a user?

974


What is the use of mysql_fetch_array () function in php?

895


What is mysql57?

878


Why do we write stored procedures?

875


Is mysql same as sql?

854


What is datadir?

839


How do I connect to mysql database?

997


Does uninstalling mysql delete database?

969


What is InnoDB?

1046


Is Mysql query is case sensitive?

986


How to create table with same structure of student table in mysql?

918