DBAsupport.com Forums - Powered by vBulletin
Results 1 to 7 of 7

Thread: combining (concatenate?) rows into one string

  1. #1
    Join Date
    May 2000
    Location
    Portsmouth, NH, USA
    Posts
    378

    Unhappy


    hi,

    my brain is out of memory. Other than using Cursors, and creating a temporary table of columns, HOW CAN I CONCATENATE ROWS OF THE SAME TABLE TOGETHER TO FORM ONE ROW OR ONE STRING?

    thanks!
    - magnus

  2. #2
    Join Date
    Jul 2001
    Location
    Singapore(Asia)-WebCentre business company
    Posts
    456
    can u be abit more specific ?? eg... ??
    ngwh,
    Singapore.

  3. #3
    Join Date
    May 2000
    Location
    Portsmouth, NH, USA
    Posts
    378

    Talking sure

    select * from test;

    row 1: abcdefg
    row 2: abcdefg

    I would like to put both rows together on one line like:
    abcdefg abcdefg


    I'll just use a cursor. I was curious if you could just use SQL or not.
    thanks,
    Magnus

  4. #4
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    You can but I have to check the book of how to do it. Tom Kyte´s book has a chapter talking about this Pivot tables

  5. #5
    Join Date
    Apr 2001
    Posts
    118

    Re: sure

    Originally posted by jgmagnus
    I was curious if you could just use SQL or not.
    You can if you know the limit to the number of rows that have to be part of the pivot. There have been multiple threads in these forums about this very thing. You should be able to find the with the search functionality.

    HTH,

    Heath

  6. #6
    Join Date
    May 2000
    Location
    Portsmouth, NH, USA
    Posts
    378

    Red face


    FYI -
    I attempted to search on this subject with 'concatenating rows'. the problem sometimes is you know WHAT you want to do, but NOT what to search under.

    I always search for what I am looking for before I actually post a question. Unfortunately, I didn't know what it was called so i couldn't do a thorough search.

    - Magnus

  7. #7
    Join Date
    Apr 2001
    Posts
    118
    Originally posted by jgmagnus

    FYI -
    I attempted to search on this subject with 'concatenating rows'. the problem sometimes is you know WHAT you want to do, but NOT what to search under.
    Fair enough.

    Did you find the threads? I was really busy Friday and didn't have time to do that for you. If you didn't find them, search using the word "pivot". You should find some good examples.

    HTH,

    Heath

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