12

First, here is the query:

SELECT GROUP_CONCAT(title) title, GROUP_CONCAT(description) description,
skill_id, count(*)

FROM jobs j
INNER JOIN job_feed_details d
ON j.id = d.job_id
JOIN jobs_skills js
ON j.id = js.job_id
    WHERE moderated = 1
    group by skill_id

Everything works as expected except the description field only returns one result, instead of a concatenation of all results. I suspect this is because the description is a text field, but I cannot find anything about why concatenation would not work with a text field.

Anyone know why this would not work?

gideon
  • 19,329
  • 11
  • 72
  • 113
jisaacstone
  • 4,234
  • 2
  • 25
  • 39

1 Answers1

44

The group_concat result length is limited(truncated) to the value of the group_concat_max_len system variable. The default value of this variable is 1024.

If you want change the value of the variable the syntax is:

SET [GLOBAL | SESSION] group_concat_max_len = val;

More info Mysql 5 docs

CronosNull
  • 1,353
  • 15
  • 24
  • 7
    ..limited by bytes, not characters. So if you are using text in utf8, result is truncated after ~363 character (see [Is group_concat_max_len in bytes or characters?](http://ebergen.net/wordpress/2011/09/05/is-group_concat_max_len-in-bytes-or-characters/)) – piotr_cz Sep 19 '13 at 10:36