Query to convert rows in to column with out using function/procedure

  • :hehe:HI

    I want to convert rows to column, through SQL and I do not want to use any functions. I am using DB2 8.2 V

    My query is:

    ID NAME BRANCH AMOUNT

    ________________________________________

    1 JOHN NY 10000

    1 JOHN NY 20000

    1 JOHN NY 10000

    2 PETER CA 50000

    2 PETER CA 40000

    Result should display like this:

    ID NAME BRANCH AMOUNT

    1 JOHN NY 10000,20000,10000

    2 PETER CA 50000,40000

    Hoping for early response

    Cheers

    🙂 chandru

  • ...are you asking a DB2 question in the Oracle section of a SQL Server forum?

    _____________________________________
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at Amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

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

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