mysql组\u concat未带来全部数据
我正在使用以下查询并使用mysql组\u concat未带来全部数据,mysql,sql,Mysql,Sql,我正在使用以下查询并使用group\u concat函数。但是,答案列中的数据有时会被切断;也就是说,我没有得到全部数据,最终它只是被切断了 我怀疑它可能与数据类型有关……它可以转换成更大的数据类型吗?当前Other1数据类型为text select SiteName, case when group_concat(Other1) is not null then group_concat( cast(Other1 AS BLOB)) when group_concat(Othe
group\u concat
函数。但是,答案
列中的数据有时会被切断;也就是说,我没有得到全部数据,最终它只是被切断了
我怀疑它可能与数据类型有关……它可以转换成更大的数据类型吗?当前Other1
数据类型为text
select SiteName,
case
when group_concat(Other1) is not null
then group_concat( cast(Other1 AS BLOB))
when group_concat(Other1) is null
then 'No Response provided'
end
'answers'
from disparities_community_partnerships
where QuarterId=2
group by SiteName
结果将被截断为group_concat_max_len系统变量给定的最大长度,该系统变量的默认值为1024。该值可以设置得更高,尽管返回值的有效最大长度受max_allowed_数据包的值约束。在运行时更改group_concat_max_len的值的语法如下,其中val是无符号整数
还有一个示例
这样执行
SET GLOBAL group_concat_max_len = 5555555;
select SiteName,
case
when group_concat(Other1) is not null
then group_concat( cast(Other1 AS BLOB))
when group_concat(Other1) is null
then 'No Response provided'
end
'answers'
from disparities_community_partnerships
where QuarterId=2
group by SiteName
在查询之前设置
组\u concat\u max\u len
:
SET GLOBAL group_concat_max_len = 9999999;
SET GLOBAL group_concat_max_len = 9999999;