Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > SQL Language
|
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 20th, 2005, 11:26 AM
Authorized User
 
Join Date: May 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Row to Column Change...Urgent..!!!!!!!!!!!


Guys

       Suppose the query is

                  Select count,premuium,state from tABLE1

      and the O/P comes in this format

      ------------------------------------------------
       COUNT PREMIUM STATE
      ------------------------------------------------
        0 100 AT
        4 888.99 CD
        2 09 NE
        0 0 CA
      ---------------------------------------------

 But i want the result to be in this new format like given below


          ---------------------------------------------------

          ---------------------------------------------------

 state AT CD NE CA

 count 0 4 2 0

 premium 100 888.9 09 0

             -----------------------------------------------------



  Does anybody know how to do this...






 
Old May 20th, 2005, 12:03 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 303
Thanks: 0
Thanked 0 Times in 0 Posts
Default

look for pivot table or cross-tab query in your database help files.

try youself atleast..
 
Old May 20th, 2005, 05:11 PM
Authorized User
 
Join Date: May 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks shahchi...........It worked.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Column to Row [email protected] Excel VBA 2 March 23rd, 2007 04:16 AM
Column to Row [email protected] SQL Server DTS 0 March 1st, 2007 10:57 AM
change row color vivek_pon VS.NET 2002/2003 3 April 13th, 2006 01:42 PM
How to get the last row and last column value ramk_1978 SQL Server 2000 1 April 4th, 2005 06:34 PM
Read a column and Search Row by Row in another col AyatKh Excel VBA 2 January 26th, 2005 12:02 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.