2

I am using GROUP_CONCAT in mysql query but the query gives me unexpected and unknown result. This is the query:

SELECT GROUP_CONCAT( DISTINCT (categoryid) )
FROM jos_community_groups
WHERE team_classification
IN (
      SELECT id
      FROM jos_league_classification
      ORDER BY winning_criteria ASC
   )
AND show_in_contact =1
AND team_state = 'Georgia'
AND categoryid
IN ( 
      SELECT sportstypeid
      FROM jos_gsa_tournament
      WHERE directorid =305
   )
ORDER BY categoryid, team_agegroup, team_classification

The result is looking like this

GROUP_CONCAT( DISTINCT ( categoryid ) )  // column
[BLOB - 10B]                             // result 

I want comma separated string of categoryid but I don't understand why query gives this type of result and what is missing in the query.

1
  • Also, can you post the entire query. The snippet you posted looks legit. Commented May 11, 2012 at 21:18

1 Answer 1

2

Question still not clear but I guess this will solve your problem. Put a cast aroung group_concat like this:

cast(group_concat(DISTINCT(categoryid)) as char)

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.