In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how to modify the length limit of the group_conca function in mysql. I hope you will gain a lot after reading this article. Let's discuss it together.
In mysql, there is a function called "group_concat". If you use it normally, you may not find a problem. When dealing with big data, you will find that the content has been intercepted.
In fact, MYSQL has a setting for this. By default, the length not set is 1024. If we need larger, we need to modify it manually.
The details are as follows:
After using group_concat, it will not work if limit is used in select.
There is a length limit when connecting fields with group_concat, not how many connections there are. But you can set it up.
Using the group_concat_max_len system variable, you can set the maximum length allowed.
The default delimiter for the system is a comma
Modification method:
SET [SESSION | GLOBAL] group_concat_max_len = 10240
Parameters that can be modified are as follows
GROUP_CONCAT accumulates the values of a field by a specified character. The default delimiter is a comma, and the character length that can be accumulated is 1024 bytes.
1. Let's give a simple example.
Select group_concat (favoa) from t_one group by fimb
Group the query by fallob, and accumulate the fancia in each group.
2. Modify the default delimiter
Select group_concat (fancia separator'_') from t_one group by fimb
Separator is a keyword, followed by a character to be separated
3. Sort
Select group_concat (order by order by favob separator'_') from t_one group by fumb
4. Modify the default character size
1) add to the MySQL configuration file
Group_concat_max_len = 102400 # the maximum length you want
2) it can be simple, execute the statement, and set the scope of action.
SET GLOBAL group_concat_max_len=102400; SET SESSION group_concat_max_len=102400
5. And concat use
Group_concat returns BLOB large objects by default. You can use concat to return strings and add other data to the returned content.
After reading this article, I believe you have a certain understanding of how to modify the length limit of the group_conca function in mysql. If you want to know more about it, welcome to follow the industry information channel. Thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.