Re: Concatenate a char field?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Pete escribió:
> In message <09D3F0C5CE9DD84D81AA6B959107B17004FC1524C9@xxxxxxxxxxxxxxxxx
> edu.pk>, moahmed-ho@xxxxxxxxxxxxxxxxxx writes
>   
>> Dear All,
>>
>>
>> In MYSQL , can we sum(concatenate) a char field ?
>>
>> e.g:
>>
>> xField
>> -------------
>> ABC
>> EFG
>> XYZ
>>
>>
>> Gather data into one .
>>
>> As -->  ABC, EFG, XYZ
>>
>>
>> Regards,
>> Mobeen.
>>     
>
> The previous poster suggested explode, which splits things up, and is
> not relevant here.
>
> The answer to your question is no, you cannot do what you want to do in
> one SQL command.
>
> Basically you have to loop through your result set, and with PHP, do
> $mystring.= $fielddata
>   
Try with this mysql function:

http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html#function_group-concat

Regards
jan


[Non-text portions of this message have been removed]


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux