merge columns to rows
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: merge columns to rows

  1. #1
    Join Date
    Aug 2011
    Posts
    2

    merge columns to rows

    Hi,
    How do I covert multiple rows into few rows of n columns

    I've data like this

    col1 col2 col2 col4 col5
    abc
    cde
    def
    123
    321
    100
    txt
    list
    xls
    1
    2
    3
    4
    5
    6

    Output needed is
    abc 123 txt 1 4
    cde 321 list 2 5
    def 100 xls 3 6

    Thanks for the help!
    ps

  2. #2
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,554
    Homework, huh?
    At least a couple of ways to do it, what is your teacher talking about these days?
    What do you have so far?
    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.

  3. #3
    Join Date
    Aug 2011
    Posts
    2

    merge columns to rows

    Paul,
    thanks for the reply.
    How do I convert to rows? Can you pl share some examples.
    It's part of the analytic functions, I'm trying to understand.
    The link provided to DB administration, book seems to be interesting.
    Thanks for your time.
    ps

Posting Permissions

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



Click Here to Expand Forum to Full Width