简体   繁体   中英

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.

Before

After

I have done this task using group_concat . But, I can use this method/function since string or character have limit in 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 .

Thanks all

The setting is connection-based and a dynamic variable. Increase it to 200000 below, for instance.

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM