Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2006
    Posts
    111

    Unanswered: concantenating multiple rows into 1

    say i have a table as follows

    table1:
    Code:
    pkeycol      col2      col3      col4
    1               1         aaa       234                                                           
    2               2         bbb       12                                                  
    3               2         ccc       241                                           
    4               3         ccc       432                                          
    5               3         ddd       23
    i would like the following result set:
    Code:
    rescol1   rescol2           rescol3
    1           aaa               234
    2           bbb, ccc        12, 241                  
    3           ccc, ddd        432, 23

    i know i could go
    Code:
    group by col2
    but how do i concatenate col3 and col4 for each distinct col2 into rescol2 and rescol3 respectively?

    again thanks so much in advance for any help :-)

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6

Posting Permissions

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