In MySql, GROUP_CONCAT() is used to convert multiple rows into a single string. However, the maximum length of the result of this function is 1024 characters.
So, You should first check the character length that GROUP_CONCAT supports in your mysql instance using below code:
SHOW VARIABLES LIKE '%group_concat%';
And You see that default character length GROUP_CONCAT supports : 1024
If 1024 character length is fine for you requirement then there is nothing to worry. But if not, you have to modify the GROUP_CONCAT character length as per your requirement as below:
SET SESSION group_concat_max_len = 1000000;
This a temporary session-scope setting. This only applies to the current session and You should use it like this.
SET SESSION group_concat_max_len = 1000000; SELECT group_concat(`field`) FROM TABLE_NAME GROUP BY `field`;
You can also do this in sharing hosting, but when you use an other session then you need to repeat the SET SESSION command.
An author of Namaste UI, published several articles focused on blogging, business, web design & development, e-commerce, finance, health, lifestyle, marketing, social media, SEO, travel.
For any types of queries, you can contact us on email@example.com.