1

I have this MySql query:

SELECT `fecha`, GROUP_CONCAT(CONCAT_WS('|', `idItem`, `nombreItem`, `cantidad`) ORDER BY `fecha`) schedule
  FROM inventarioStat
 GROUP BY fecha

the thing is it doesnt display all the data in the data it should. It only displays the last 50 or so entry? Is there some kind of limit or something Im not seeing?

Can you push me in the right direction?

1 Answer 1

4

According to this page in the manual, the result is truncated.

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

The result is truncated to the maximum length that is given by the group_concat_max_len system variable, which has a default value of 1024. The value can be set higher, although the effective maximum length of the return value is constrained by the value of max_allowed_packet.

try to change this setting to see if this is the case:

SET [GLOBAL | SESSION] group_concat_max_len = val;
Sign up to request clarification or add additional context in comments.

4 Comments

Thanks for the quick answer, this is it. Any advice how should I go about it? Whats the consequences of raising the max allowed packet? Is there a way around?
You could allways just select all content as individual rows and concat in your application logic.
Im sorry , but that exceeds my knowledge of mysql. What kind of query would that be?
Just omit the GROUP_CONCAT, CONCAT_WS and GROUP BY clauses. Do a plain standard SELECT and do everything in your application.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.