www.webdeveloper.com
Results 1 to 3 of 3

Thread: [RESOLVED] string concatenation

  1. #1
    Join Date
    Jul 2011
    Posts
    131

    resolved [RESOLVED] string concatenation

    Hi,
    Is it possible to write function like SUM() but for strings?
    I have a table categories with fields id, name, parent_id
    and I need a query something like this:
    Code:
    select *, STR_SUM(category.name) as cat_name from categories
            group by category.parent_id
    where STR_SUM() - a function for string concatenation.
    It has to return a list like this: 'cat1, cat2, cat3'
    Thanks!
    Last edited by kromol; 09-22-2011 at 09:56 AM.

  2. #2
    Join Date
    Sep 2011
    Posts
    27
    yes, you are looking for
    GROUP_CONCAT


    source
    http://dev.mysql.com/doc/refman/5.0/...functions.html

  3. #3
    Join Date
    Jul 2011
    Posts
    131
    Thank you very much!
    It is that I need.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles