[英]Stored procedure, function, or cursor mysql combine multiple rows to one row without using group_concat
I have a problem in production database. 我在生产数据库中有问题。 Currently, I have task like this below image.
目前,我在下图有这样的任务。
I have done this task using group_concat
. 我已经使用
group_concat
完成了此任务。 But, I can use this method/function since string or character have limit in 1024 . 但是,我可以使用此方法/函数,因为字符串或字符在1024中有限制。 I can change this even administrator or someone.
我甚至可以更改此管理员或某人。 Because application will down temporary.
因为应用程序将暂时关闭。 This is too risk in production.
这在生产中太冒险了。
So, I'm gonna ask if someone have idea or ever create stored procedure, function, or cursor like group_concat
. 所以,我要问是否有人有想法或曾经创建存储过程,函数或类似
group_concat
游标。
Thanks all 谢谢大家
The setting is connection-based and a dynamic variable. 该设置基于连接,是一个动态变量。 Increase it to 200000 below, for instance.
例如,将其增加到200000以下。
SET SESSION group_concat_max_len = 200000;
SELECT @@group_concat_max_len;
+------------------------+
| @@group_concat_max_len |
+------------------------+
| 200000 |
+------------------------+
See the manual page for group_concat_max_len
. 请参见手册页中的
group_concat_max_len
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.