gpt4 book ai didi

mysql - group_concat_max_len 在 nodejs 中设置

转载 作者:行者123 更新时间:2023-11-29 05:58:02 26 4
gpt4 key购买 nike

我正在使用 mysql npm Node 应用程序中的包,我有一个查询,我在哪里使用 group_concat

select 
group_concat(tpr.parentId) as tmParentIds
from user AS U LEFT JOIN tm_parent_relationship tpr ON U.userId = tpr.tmId
where U.userRole = '5' AND U.userStatus = 1 AND U.userId = 223
group by U.userId
ORDER BY U.userId DESC

它应该返回长字符(超过 1024 个),但它只发送 1024 个字符的长字符串,这是它的默认功能。如何增加长度,我在 Node 角度找不到任何地方。

提前致谢。

最佳答案

connection.query('SET SESSION group_concat_max_len = 10000');



connection.query(query, function (error, results, fields) {
return cb(error,results);
});

关于mysql - group_concat_max_len 在 nodejs 中设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47550913/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com