Thanks Jay, I got the solution. Thanks for all the members responding. With warm regards, VR Venugopal Rao
-----Original Message----- From: Jay Blanchard [mailto:jblanch...@pocket.com] Sent: 28 April 2010 16:58 To: VR Venugopal Rao; MySQL Subject: RE: Pivot Query in [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 ______________________________________________________________________________ DISCLAIMER The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or directly to netsupp...@cmcltd.com or telephone and immediately and permanently delete the message and any attachments. Thank you. ______________________________________________________________________________ This email has been scrubbed for your protection by SecureMX. For more information visit http://securemx.in ______________________________________________________________________________ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql?unsub=arch...@jab.org