Transpose Rows in to Coumns

  • Hi

    I need to transpose the data in Sql 2000, can some one help me

    Eg:

    Main Table :

    Item Price

    A 100

    B 50

    Item cp amnt

    A R1 10

    A R2 10

    B R1 4

    B R2 5

    I need this to be formatted like

    Item price R1 R2

    A 100 10 10

    B 50 4 5

    Thanks

  • Hi,

    please see the following article on how to use cross tabs to get the results you ask for.

    http://www.sqlservercentral.com/articles/T-SQL/63681/

    If you need to get specific answers for your issue please read the following article and provide data as described.

    http://www.sqlservercentral.com/articles/Best+Practices/61537/



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply