0
点赞
收藏
分享

微信扫一扫

Mysql group_concat的长度限制

梦幻之云 2022-03-31 阅读 81
mysql

业务突然告知某些数据查询不到,经过查询发现用到了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 条评论