SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: merging rows

  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2006
    Posts
    94
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    merging rows

    I have a result set like this:

    Code:
    REQ_CO   	 time   	 USER_NA_FULL   	 MSG
    00000007 	21/02/2003 13:40:59 	Mr X	Please return the failed product for the investiga...
    00000007 	08/04/2003 13:11:49 	Mr Y 	I will submit an official conclusion repor...
    00000009 	28/02/2003 10:57:38 	Mr X 	Please return the thing for the investigation a...
    00000009 	28/02/2003 18:01:10 	Mrs M 	 
    00000009 	31/03/2003 17:37:45 	Mrs M 	Can you please tell us the location of serial numb...
    I want to combine/merge the rows together where REQ_CO is the same.

    The result should be like this:

    Code:
    REQ_CO     merged_txt
    00000007   "21/02/2003 13:40:59 	Mr X	Please return the failed product for the investiga... 28/02/2003 10:57:38 	Mr X 	Please return the thing for the investigation a..."
    00000009   "28/02/2003 10:57:38 	Mr X 	Please return the thing for the investigation a...28/02/2003 18:01:10 	Mrs M   ...31/03/2003 17:37:45 	Mrs M 	Can you please tell us the location of serial numb..."
    Is it possible to do in MySQL?

  2. #2
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    yes, but it's probably not worth doing since you're likely to hit the character limit of group_concat(). what you're requesting appears to be presentational and should be accomplished in your host language, not SQL.
    Check out our new Industry News forum!
    Keep up-to-date with the latest SP news in the Community Crier

    I edit the SitePoint Podcast


Bookmarks

Posting Permissions

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