Mysql group_concat的长度限制

阅读 81

2022-03-31

业务突然告知某些数据查询不到,经过查询发现用到了group_concat函数,分析后发现结果集数据少了。

        因为group_concat默认是有长度限制的,修改group_concat_max_len 参数后,问题解决。

mysql> show global variables like '%group_con%';
+----------------------+-------+
| Variable_name        | Value |
+----------------------+-------+
| group_concat_max_len | 1024  |
+----------------------+-------+
1 row in set (0.00 sec)

mysql> set global group_concat_max_len=8096;
Query OK, 0 rows affected (0.00 sec)

mysql> show global variables like '%group_con%';
+----------------------+-------+
| Variable_name        | Value |
+----------------------+-------+
| group_concat_max_len | 8096  |
+----------------------+-------+
1 row in set (0.01 sec)

精彩评论(0)

0 0 举报