Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2002
    Location
    Chennai, India
    Posts
    184

    Unanswered: Convert rows to column

    I have the following table contents:
    MONTH STATES
    ----------- ----------------------
    1 5177
    2 640
    3 6029
    4 11086
    5 2131


    I need to convert this to:

    MONTH 1 2 3 4 5

    STATES 5177 640 6029 11086 2131


    How can I do this?

    TIA.

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    There are a number of threads in this forum about this .. One such thread is :

    http://www.dbforums.com/showthread.p...ight=transpose

    Unless you have a definitve list of columns (which in this case is MONTH), you do not have a pure SQL

    HTH

    Sathyaram
    Visit the new-look IDUG Website , register to gain access to the excellent content.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •