Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

using group_concat in PHPMYADMIN will show the result as [BLOB - 3B]

I have a query which uses the GROUP_CONCAT of mysql on an integer field.
I am using PHPMYADMIN to develop this query. My problem that instead of showing 1,2 which is the result of the concatenated field, I get [BLOB - 3B].

Query is

SELECT rec_id,GROUP_CONCAT(user_id) FROM t1 GROUP BY rec_id 

(both fields are unsigned int, both are not unique)

What should I add to see the actual results?

like image 526
Itay Moav -Malimovka Avatar asked Jan 25 '10 16:01

Itay Moav -Malimovka


1 Answers

Looks as though GROUP_CONCAT expects that value to be a string. I just ran into the same problem. Solved it by converting the int column to a string like so:

SELECT rec_id,GROUP_CONCAT(CONVERT(user_id, CHAR(8))) FROM t1 GROUP BY rec_id 

Figured I'd share in case you were still having an issue with this.

like image 167
munch Avatar answered Oct 26 '22 03:10

munch