I have a query which returns the count of a status that needs some very complex work to calculate. The user wants to drill down into that list, and I thought the easiest way would be to get the ids using GROUP_CONCAT.
Unfortunately, the result from GROUP_CONCAT is being truncated to 1024 (?!) characters.
Is it possible to get more than 1024 characters, or am I going about this the wrong way?
Show activity on this post. I'm using GROUP_CONCAT() in a MySQL query to convert multiple rows into a single string. However, the maximum length of the result of this function is 1024 characters.
GROUP_CONCAT is a function which concatenates/merges the data from multiple rows into one field. It is a GROUP BY function which returns a string if the group contains at least 1 non-null value, if it does not, it returns a Null value.
You need to set group_concat_max_len
to a higher value. This can be done on a session or global level. The following query sets the max length to 10,000 for the rest of the queries in that session:
SET SESSION group_concat_max_len = 10000;
What you're running into is the group_concat
default max of 1024.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With