From: Peter Brawley Date: May 3 2010 5:10am Subject: Re: How to Get Running Totals. List-Archive: http://lists.mysql.com/mysql/221491 Message-Id: <4BDE5ABB.70904@earthlink.net> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------060100050308020702030109" --------------060100050308020702030109 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit >I am trying to get running totals See "Running sum" at http://www.artfulsoftware.com/infotree/queries.php. PB ----- Venugopal Rao wrote: > I am trying to get running totals for the following: > Project Code---R&D---STP--RunningTotal > 1007303----------04-------04---8 > 1007304----------04-------04---16 > > I tried to follow the examples available on the site but it is giving errors. > I am using java as a middleware and mysql as back end. > I am trying ot use backend query for getting the results. > response with examples will be more helpful. > With regards, > VR Venugopal Rao > > > > > --- On Wed, 28/4/10, Jay Blanchard wrote: > > > From: Jay Blanchard > Subject: RE: Pivot Query in > To: "VR Venugopal Rao" , "MySQL" > Date: Wednesday, 28 April, 2010, 4:57 PM > > > [snip] > Date, ProjectCode Building, Number of Copies > > I want to get a Connsolidate Report of > > Project Code R&D STP > > 1007304----------04-------04 > > (Group by Project Code)(Sumtotal Building wise). > > I have tried to execute the following code : > > select pcode, building, sum(ncopies) from request group by > pcode,building > > It is giving the following repott > > 1007304--R&D--04 > > 1007304-STP--05 > > Here there is a repetition of pcode, > > How can I avoid this. I want to get the Building Name on top as Column > Names > and bottom I should get the Count. > [/snip] > > We would need to see some of the raw data to help you but this older > article may point you in the right direction with crosstab (pivot) > queries; > > http://www.evolt.org/node/26896 > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: http://lists.mysql.com/mysql?unsub=vr_vrao@stripped > > > > > > ------------------------------------------------------------------------ > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 8.5.437 / Virus Database: 271.1.1/2849 - Release Date: 05/02/10 06:27:00 > > --------------060100050308020702030109--