[ciapug] concating columns of strings
Colin Burnett
cmlburnett at gmail.com
Thu May 1 14:12:11 CDT 2008
group_concat :)
http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html#function_group-concat
Colin
On Thu, May 1, 2008 at 1:50 PM, Dave J. Hala Jr. <dave at 58ghz.net> wrote:
> I'd like to find a way to take a column of strings and concat all the
> values. We what I want to do is analogous to summing a numeric column
> while grouping.
>
> What I do with the numeric column is:
>
> SELECT SUM(amount) as total FROM mytable GROUP BY vendor
>
> I'd like to do the same thing with a character field. Suppose that the
> field has a character value of A,B or C. I'd like the query to return
> "ABC" if there are 3 records with those values for each vendor.
>
> Anyone try to do this before? It would appear that the Mysql 4.x concat
> function is not built for this. Any thoughts?
>
> :) Dave
>
>
>
>
>
> --
> ___
> Dave J. Hala Jr.
> President OSIS, Inc.
> www.osis.us
More information about the ciapug
mailing list